Reintent

Drawing λ

Read λ from the intent, send what it asks for once it is shown, and draw it again when it changes, by hand or in React.

For the dinner, Sam prints the card, and the family also sees it in Sam's app. Both are hosts: each takes λ from the intent and draws it its own way. Each needs to receive updates when System One answers and whenever Sam changes the tone.

You will learn

  • How intent.realize() reads λ without sending model requests
  • How intent.connect(host) commits trees and follows changes
  • How React shows λ with reintentView and implement, and reads and changes a root with useReintent
  • How a host marks a part of the card as held elsewhere

Evaluate and show

createIntent({ program: <App /> }) creates an intent that owns its program, choices and history; its configuration is IntentOptions. intent.realize() evaluates and validates its data tree. Without a model answer it reads the current default; it never requests an answer.

/** @jsxImportSource @reintent/core */
import { action, choices, host, useChoiceStatus } from '@reintent/core';

export type Person = { to: string; age: number; from: string };
export const TONES = ['warm', 'funny', 'formal'] as const;
export type Tone = (typeof TONES)[number];

export const GRANDMA: Person = { to: 'Grandma', age: 90, from: 'Sam' };

export const LOOK: Record<Tone, { background: string; accent: string }> = {
  warm: { background: '#fdebd3', accent: '#b5562b' },
  funny: { background: '#fff2a8', accent: '#7a4fd6' },
  formal: { background: '#f1eee8', accent: '#2b2b2b' },
};

export function title(p: Person, tone: Tone) {
  if (tone === 'formal') return `Many happy returns, ${p.to}.`;
  if (tone === 'warm') return `Happy ${p.age}th birthday, ${p.to}!`;
  return `${p.age} laps around the sun, ${p.to}!`;
}

/** The card's tone, and which layer it came from: System One weighs it; a person's decision is above its judgment. */
export function useToneStatus() {
  return useChoiceStatus(choices<Tone>(...TONES), {
    of: 'card',
    name: 'tone',
    defaultValue: 'warm',
    question: 'Which tone suits a birthday card for Grandma, turning 90?',
    ask: ['model'],
  });
}

export function useTone() {
  return useToneStatus().value;
}

export function Card(p: Person) {
  const tone = useTone();
  return host('div', {
    style: {
      maxWidth: 380,
      padding: '1.5em',
      borderRadius: 12,
      background: LOOK[tone].background,
      color: '#3a2a1c',
    },
    children: [
      host('h1', { style: { color: LOOK[tone].accent }, children: title(p, tone) }),
      host('p', { children: 'Wishing you a wonderful day.' }),
      host('p', { style: { textAlign: 'right', fontStyle: 'italic' }, children: `— ${p.from}` }),
    ],
  });
}

export function Buttons() {
  const tone = useToneStatus();
  const row = <T extends string>(name: string, values: readonly T[], now: { value: T; source: string }) =>
    host('p', {
      children: [
        ...values.map((v) =>
          // A person's decision is pressed; a value the card took on its own is only marked.
          host('button', {
            disabled: now.source === 'decision' && v === now.value,
            ...(now.source !== 'decision' &&
              v === now.value && { style: { textDecoration: 'underline dotted' } }),
            onClick: action.decide({ of: 'card', name }, v),
            children: v,
          }),
        ),
        // The person's way of not deciding: forget the decision, and the card picks again.
        host('button', {
          disabled: now.source !== 'decision',
          onClick: action.forget({ of: 'card', name }),
          style: {
            marginLeft: 12,
            borderStyle: 'dashed',
            fontStyle: 'italic',
            ...(now.source === 'decision' && { background: 'transparent' }),
          },
          children: 'no preference',
        }),
      ],
    });
  return host('div', { children: [row('tone', TONES, tone)] });
}

export default function App() {
  return host('div', { children: [<Card {...GRANDMA} />, <Buttons />] });
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

The printing host receives trees through intent.connect({ commit(tree) { … } }). After each successful commit, the runtime sends the model requests that tree needs, then commits again when answers arrive. The recorded answer here is synchronous, so reading realize() after connecting gives the formal card.

The returned Realization contains λ as tree, the choices it read as reads, remaining model requests as requests, and what cannot settle as unresolved. Buttons describe operations with ordinary action.decide and action.forget data; the host passes those records to intent.act.

Read while drawing, send once shown

Drafts and offline output only call realize; a continuing display establishes a connection:

/** @jsxImportSource @reintent/core */
import { action, choices, host, useChoiceStatus } from '@reintent/core';

export type Person = { to: string; age: number; from: string };
export const TONES = ['warm', 'funny', 'formal'] as const;
export type Tone = (typeof TONES)[number];

export const GRANDMA: Person = { to: 'Grandma', age: 90, from: 'Sam' };

export const LOOK: Record<Tone, { background: string; accent: string }> = {
  warm: { background: '#fdebd3', accent: '#b5562b' },
  funny: { background: '#fff2a8', accent: '#7a4fd6' },
  formal: { background: '#f1eee8', accent: '#2b2b2b' },
};

export function title(p: Person, tone: Tone) {
  if (tone === 'formal') return `Many happy returns, ${p.to}.`;
  if (tone === 'warm') return `Happy ${p.age}th birthday, ${p.to}!`;
  return `${p.age} laps around the sun, ${p.to}!`;
}

/** The card's tone, and which layer it came from: System One weighs it; a person's decision is above its judgment. */
export function useToneStatus() {
  return useChoiceStatus(choices<Tone>(...TONES), {
    of: 'card',
    name: 'tone',
    defaultValue: 'warm',
    question: 'Which tone suits a birthday card for Grandma, turning 90?',
    ask: ['model'],
  });
}

export function useTone() {
  return useToneStatus().value;
}

export function Card(p: Person) {
  const tone = useTone();
  return host('div', {
    style: {
      maxWidth: 380,
      padding: '1.5em',
      borderRadius: 12,
      background: LOOK[tone].background,
      color: '#3a2a1c',
    },
    children: [
      host('h1', { style: { color: LOOK[tone].accent }, children: title(p, tone) }),
      host('p', { children: 'Wishing you a wonderful day.' }),
      host('p', { style: { textAlign: 'right', fontStyle: 'italic' }, children: `— ${p.from}` }),
    ],
  });
}

export function Buttons() {
  const tone = useToneStatus();
  const row = <T extends string>(name: string, values: readonly T[], now: { value: T; source: string }) =>
    host('p', {
      children: [
        ...values.map((v) =>
          // A person's decision is pressed; a value the card took on its own is only marked.
          host('button', {
            disabled: now.source === 'decision' && v === now.value,
            ...(now.source !== 'decision' &&
              v === now.value && { style: { textDecoration: 'underline dotted' } }),
            onClick: action.decide({ of: 'card', name }, v),
            children: v,
          }),
        ),
        // The person's way of not deciding: forget the decision, and the card picks again.
        host('button', {
          disabled: now.source !== 'decision',
          onClick: action.forget({ of: 'card', name }),
          style: {
            marginLeft: 12,
            borderStyle: 'dashed',
            fontStyle: 'italic',
            ...(now.source === 'decision' && { background: 'transparent' }),
          },
          children: 'no preference',
        }),
      ],
    });
  return host('div', { children: [row('tone', TONES, tone)] });
}

export default function App() {
  return host('div', { children: [<Card {...GRANDMA} />, <Buttons />] });
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

  • The first intent.realize() gives the warm default and a judge request that has not been sent.
  • connect passes the tree to the host. Returning from commit, or resolving its returned Promise, means the host has accepted it.
  • Only a still-current commit sends requests. Answers update the intent and the connection commits the next tree automatically.

Send for what is shown

Changes during an asynchronous commit coalesce to the latest input. An old acknowledgement sends nothing for superseded input; a late acknowledgement after disconnect also sends nothing.

Drawing again

When Sam changes the tone, the printed page follows:

/** @jsxImportSource @reintent/core */
import { action, choices, host, useChoiceStatus } from '@reintent/core';

export type Person = { to: string; age: number; from: string };
export const TONES = ['warm', 'funny', 'formal'] as const;
export type Tone = (typeof TONES)[number];

export const GRANDMA: Person = { to: 'Grandma', age: 90, from: 'Sam' };

export const LOOK: Record<Tone, { background: string; accent: string }> = {
  warm: { background: '#fdebd3', accent: '#b5562b' },
  funny: { background: '#fff2a8', accent: '#7a4fd6' },
  formal: { background: '#f1eee8', accent: '#2b2b2b' },
};

export function title(p: Person, tone: Tone) {
  if (tone === 'formal') return `Many happy returns, ${p.to}.`;
  if (tone === 'warm') return `Happy ${p.age}th birthday, ${p.to}!`;
  return `${p.age} laps around the sun, ${p.to}!`;
}

/** The card's tone, and which layer it came from: System One weighs it; a person's decision is above its judgment. */
export function useToneStatus() {
  return useChoiceStatus(choices<Tone>(...TONES), {
    of: 'card',
    name: 'tone',
    defaultValue: 'warm',
    question: 'Which tone suits a birthday card for Grandma, turning 90?',
    ask: ['model'],
  });
}

export function useTone() {
  return useToneStatus().value;
}

export function Card(p: Person) {
  const tone = useTone();
  return host('div', {
    style: {
      maxWidth: 380,
      padding: '1.5em',
      borderRadius: 12,
      background: LOOK[tone].background,
      color: '#3a2a1c',
    },
    children: [
      host('h1', { style: { color: LOOK[tone].accent }, children: title(p, tone) }),
      host('p', { children: 'Wishing you a wonderful day.' }),
      host('p', { style: { textAlign: 'right', fontStyle: 'italic' }, children: `— ${p.from}` }),
    ],
  });
}

export function Buttons() {
  const tone = useToneStatus();
  const row = <T extends string>(name: string, values: readonly T[], now: { value: T; source: string }) =>
    host('p', {
      children: [
        ...values.map((v) =>
          // A person's decision is pressed; a value the card took on its own is only marked.
          host('button', {
            disabled: now.source === 'decision' && v === now.value,
            ...(now.source !== 'decision' &&
              v === now.value && { style: { textDecoration: 'underline dotted' } }),
            onClick: action.decide({ of: 'card', name }, v),
            children: v,
          }),
        ),
        // The person's way of not deciding: forget the decision, and the card picks again.
        host('button', {
          disabled: now.source !== 'decision',
          onClick: action.forget({ of: 'card', name }),
          style: {
            marginLeft: 12,
            borderStyle: 'dashed',
            fontStyle: 'italic',
            ...(now.source === 'decision' && { background: 'transparent' }),
          },
          children: 'no preference',
        }),
      ],
    });
  return host('div', { children: [row('tone', TONES, tone)] });
}

export default function App() {
  return host('div', { children: [<Card {...GRANDMA} />, <Buttons />] });
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

connect handles the initial commit and subsequent updates. This host's commit prints only when the words change. The page owner calls connection.disconnect() when the page closes. See Standalone hosts.

In React: reintentView

Sam's app is written in React. The card's program is a root, and reintentView makes it a React component; ReintentProvider gives it the model:

card.intent.tsx
import { action, choices, host, useChoose } from '@reintent/core';

export default function Card(p: { to: string }) {
  const tone = useChoose(choices('warm', 'formal'), {
    of: 'card',
    name: 'tone',
    defaultValue: 'warm',
  });
  return host('div', {
    children: [
      host('h1', { children: tone === 'warm' ? `Happy birthday, ${p.to}!` : `Many happy returns, ${p.to}.` }),
      host('button', { onClick: action.decide({ of: 'card', name: 'tone' }, 'formal'), children: 'Formal' }),
    ],
  });
}
App.tsx
import { ReintentProvider, reintentView } from '@reintent/react';
import CardProgram from './card.intent';

const Card = reintentView(CardProgram);

export function App() {
  return (
    <ReintentProvider model={model}>
      <Card to="Grandma" />
    </ReintentProvider>
  );
}

Each <Card> owns its Intent, and to is the root's input. A click on Formal goes to that Intent; the card draws again. See Roots in React.

Sam's app below is written the same way. The card's root takes to, age and from, and Sam's tone buttons are its children:

/** @jsxImportSource @reintent/dom */
import { choices, useChoiceStatus, type Content } from '@reintent/core';

export type Person = { to: string; age: number; from: string };
export const TONES = ['warm', 'funny', 'formal'] as const;
export type Tone = (typeof TONES)[number];

export const LOOK: Record<Tone, { background: string; accent: string }> = {
  warm: { background: '#fdebd3', accent: '#b5562b' },
  funny: { background: '#fff2a8', accent: '#7a4fd6' },
  formal: { background: '#f1eee8', accent: '#2b2b2b' },
};

export function title(p: Person, tone: Tone) {
  if (tone === 'formal') return `Many happy returns, ${p.to}.`;
  if (tone === 'warm') return `Happy ${p.age}th birthday, ${p.to}!`;
  return `${p.age} laps around the sun, ${p.to}!`;
}

/** The card's tone, and which layer it came from: System One weighs it; a person's decision is above its judgment. */
export function useToneStatus() {
  return useChoiceStatus(choices<Tone>(...TONES), {
    of: 'card',
    name: 'tone',
    defaultValue: 'warm',
    question: 'Which tone suits a birthday card for Grandma, turning 90?',
    ask: ['model'],
  });
}

export function useTone() {
  return useToneStatus().value;
}

export function Card(p: Person) {
  const tone = useTone();
  return (
    <div
      style={{
        maxWidth: 380,
        padding: '1.5em',
        borderRadius: 12,
        background: LOOK[tone].background,
        color: '#3a2a1c',
      }}
    >
      <h1 style={{ color: LOOK[tone].accent }}>{title(p, tone)}</h1>
      <p>Wishing you a wonderful day.</p>
      <p style={{ textAlign: 'right', fontStyle: 'italic' }}>— {p.from}</p>
    </div>
  );
}

/** The card for whoever the props say, and Sam's app's own controls in its children (App.tsx). */
export default function App(p: Person & { children?: Content }) {
  return (
    <div>
      <Card {...p} />
      {p.children}
    </div>
  );
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

ToneButtons sits in the card's children, a slot the program places under the card, and its state stays React's. It gets the card's operations from useReintent(), and a click calls decide. The operations are one object for as long as the root lives, a ReintentActions: a write resolves when the intent took it, and rejects with a Refused when the intent refused it. They are the same whether the card's Intent is on this page or in a worker (Handles).

Drawing with the app's components

The intent can say where the tone picker goes and leave how it looks to the app. The program places a kind of the app's catalog, tone-picker, and the app gives the component that draws it with implement (Host catalogs); a kind of the DOM catalog is drawn as its element:

hosts.tsx
import { implement } from '@reintent/react';
import { card } from './catalog';

export const hosts = implement(card, {
  'tone-picker': (p) => <TonePicker tone={p.tone} onPick={p.pick} />,
});

<ReintentProvider components={hosts} model={model}>
  <Card to="Grandma" />
</ReintentProvider>;
/** @jsxImportSource react */
import { implement, ReintentProvider, reintentView } from '@reintent/react';
import Program from './App.intent';
import { card, TONES } from './catalog';
import { recordedModel } from './model';

/** The app's components for its catalog's kinds; the DOM's are drawn as the element of their name. */
const hosts = implement(card, {
  'tone-picker': (p) => {
    const decided = p.source === 'decision';
    return (
      <p>
        {TONES.map((t) => (
          <button
            key={t}
            disabled={decided && t === p.tone}
            style={!decided && t === p.tone ? { textDecoration: 'underline dotted' } : undefined}
            onClick={() => p.pick(t)}
          >
            {t}
          </button>
        ))}
        <button
          disabled={!decided}
          style={{ marginLeft: 12, borderStyle: 'dashed', fontStyle: 'italic' }}
          onClick={() => p.clear()}
        >
          no preference
        </button>
      </p>
    );
  },
});

// The card as a React component: its props are the root's input.
const Card = reintentView(Program);
const model = recordedModel();

export default function App() {
  return (
    <ReintentProvider components={hosts} model={model}>
      <Card to="Grandma" age={90} from="Sam" />
    </ReintentProvider>
  );
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

catalog.ts declares the app's catalog, card: the DOM catalog, and a tone-picker whose pick event takes a tone from the host and whose clear takes none. Picker in App.intent.tsx places it with hostOf(card), holding action.decide and action.forget for the tone. App.tsx gives its component with implement(card, …), and p.pick(t) sends the decide with t. The DOM's kinds, div and p here, are drawn as the element of their name.

Roots in React

A root is a program React mounts. reintentView(Card) makes a React component of it: each <Card> owns an Intent of its own, its props are the root's input, and React content in them (children, a footer) is the content of a slot of that name. A root's props are data or React content: a function is neither, and a root given one throws. ReintentProvider gives the roots under it how to draw and the model, a ReintentHost; it holds no Intent.

App.tsx
import { ReintentProvider, reintentView } from '@reintent/react';
import CardProgram from './card.intent';

const Card = reintentView(CardProgram);

<ReintentProvider components={hosts} model={model}>
  <Card to="Ann">
    <ShareButton />
  </Card>
</ReintentProvider>;
  • A render reads only; React sets the input once it commits, draws again, and only that drawing is presented. A render React drops asks for nothing. Hiding a root in <Activity> keeps its Intent.
  • useReintent() gives a component inside a root (in its children, or one that draws its kinds) the root's operations; a ref on <Card> gives the same. useReintent(select) reads the root, a ReintentState: the Intent's state, and what the evaluation it draws in this render found (reads, unresolved). useReintent(card, select) reads an Intent named from outside a root. Props are typed by the root's, a RootProps: a Content prop takes React content.
  • reintent-views writes card.intent.view.ts beside each root, export default reintentView(Card, 'Card'), so React code imports ./card.intent.view and gets the root's props as its types; intent modules and Node keep importing ./card.intent. Only a file's default export is a root (viewOf); --check (writeViews) fails when a view is missing or stale, a ViewOf says why.
  • <ReintentView intent> shows an Intent made elsewhere. It does not set the input; its children and slots, a Slots, are this view's own content, so two views of one Intent each show theirs. A slot the program places that this view gives no content for is an error before anything is shown.

Kinds as tags

A catalog's JSX entry writes its kinds as lowercase tags, typed by the catalog (A catalog's JSX). In the sandbox in Drawing with the app's components, card/jsx-runtime.ts is the entry of card, written by jsxEntry, and App.intent.tsx starts with its line:

App.intent.tsx
/** @jsxImportSource ./card */

export function Picker() {
  const tone = useToneStatus();
  return (
    <tone-picker
      tone={tone.value}
      source={tone.source}
      pick={action.decide(TONE)}
      clear={action.forget(TONE)}
    />
  );
}

<tone-picker> is the same host node as host('tone-picker', …). A kind outside the catalog, or a prop it does not take, is a type error, and every frame is checked against the catalog too. In a package, the entry is the package's ./jsx-runtime, and the line names the package (@jsxImportSource @app/card).

HostElements types tags for @reintent/core's own JSX, with no catalog behind it: a kind declared there type-checks, and nothing checks a frame against it. A Web host draws through a catalog, so an app declares its kinds in its catalog.

An intent file may also be written in React's JSX: the Intent reads React's elements as its own, a ForeignElement. Components are components, <> is a fragment, and a lowercase tag is a host node. With @reintent/react imported, HostElements are also React's intrinsic elements, so a kind declared there type-checks in both. A React hook in an intent throws when the Intent is realized.

Watching the Intent

Undo and redo are the app's own, in the card's children. They read the card's history, which λ does not hold:

/** @jsxImportSource react */
import { implement, ReintentProvider, reintentView, useReintent } from '@reintent/react';
import Program from './App.intent';
import { card, TONES } from './catalog';
import { recordedModel } from './model';

/** The app's components for its catalog's kinds; the DOM's are drawn as the element of their name. */
const hosts = implement(card, {
  'tone-picker': (p) => {
    const decided = p.source === 'decision';
    return (
      <p>
        {TONES.map((t) => (
          <button
            key={t}
            disabled={decided && t === p.tone}
            style={!decided && t === p.tone ? { textDecoration: 'underline dotted' } : undefined}
            onClick={() => p.pick(t)}
          >
            {t}
          </button>
        ))}
        <button
          disabled={!decided}
          style={{ marginLeft: 12, borderStyle: 'dashed', fontStyle: 'italic' }}
          onClick={() => p.clear()}
        >
          no preference
        </button>
      </p>
    );
  },
});

// The card as a React component: its props are the root's input.
const Card = reintentView(Program);
const model = recordedModel();

/** Outside λ: the history, watched on the card's Intent. */
function UndoRedo() {
  const { history } = useReintent();
  const canUndo = useReintent((s) => s.history.canUndo);
  const canRedo = useReintent((s) => s.history.canRedo);
  const last = useReintent((s) => s.history.notes.at(-1));
  return (
    <p>
      <button disabled={!canUndo} onClick={() => void history.undo()}>
        Undo
      </button>
      <button disabled={!canRedo} onClick={() => void history.redo()}>
        Redo
      </button>
      {last && <small style={{ marginLeft: 12 }}>last: {last}</small>}
    </p>
  );
}

export default function App() {
  return (
    <ReintentProvider components={hosts} model={model}>
      <Card to="Grandma" age={90} from="Sam">
        <UndoRedo />
      </Card>
    </ReintentProvider>
  );
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

useReintent(select) returns select of the root's state and renders again when what it selects changes. Nothing is sent. The state is data: revision, version, layers, history and input, and what the evaluation this root draws found, reads (each choice it read: its value, where it came from, whether it settled) and unresolved (what it could not settle). UndoRedo reads history.canUndo, history.canRedo and the last of history.notes, and calls history.undo() and redo() from useReintent(). Pick a tone, then Undo. select may build a new value each time, such as a list or an object: it is worked out once per change.

Held elsewhere

Aunt May writes her own line in the card, on her phone. While she has it open, the line is hers, and Sam's app should hold its place and leave its choices alone.

/** @jsxImportSource @reintent/core */
import { choices, host, useChoose, useLoaded } from '@reintent/core';

export const MAY_LINES = ['Remember the summer at the lake?', 'Here is to the next ten!'] as const;
export type MayLine = (typeof MAY_LINES)[number];

/** What the app does when May opens her line on her phone, or is done: the intent gives it (index.intent.tsx). */

/** Aunt May's line: hers to write. While she has it open on her phone, the card only holds its place. */
function MayLine() {
  if (!useLoaded('may'))
    return host('p', { style: { opacity: 0.6, fontStyle: 'italic' }, children: 'May is writing her line…' });
  const line = useChoose(choices<MayLine>(...MAY_LINES), {
    of: 'may',
    name: 'line',
    defaultValue: 'Here is to the next ten!',
  });
  return host('p', { children: `${line} — May` });
}

function Card() {
  return host('div', {
    style: { maxWidth: 380, padding: 24, borderRadius: 12, background: '#fdebd3', color: '#3a2a1c' },
    children: [
      host('h1', { style: { color: '#b5562b' }, children: 'Happy 90th birthday, Grandma!' }),
      host('p', { children: 'Wishing you a wonderful day.' }),
      <MayLine />,
      host('p', { style: { textAlign: 'right', fontStyle: 'italic' }, children: '— Sam' }),
    ],
  });
}

/** Stands in for May's phone telling Sam's app. */
function MaysPhone() {
  const away = !useLoaded('may');
  return host('p', {
    children: host('button', {
      onClick: { event: 'unload', args: ['may', !away] },
      children: away ? 'May is done' : 'May opens her line on her phone',
    }),
  });
}

export default function App() {
  return host('div', { children: [<Card />, <MaysPhone />] });
}
ChoicesC

Starting…

Realizationλ

Starting…

What happened

Nothing logged.

intent.unload('may', true) tells the intent that everything of: 'may' is held elsewhere. useLoaded('may') is false then, and MayLine draws a placeholder and returns before reading its choice. Choices is empty, and nothing defaults and nothing is asked. intent.unload('may', false) brings the line back, with whatever was decided for it. Click the button under the card to try both. Unloading is the host's bookkeeping and stays out of the history, so undo leaves it as it is.

A choice held elsewhere reads as unknown

A component that reads a choice of an unloaded entity anyway gets its default value, with source and status both 'unknown', and the intent sends no judgment for it.

Recap

  • intent.realize(provide?) reads and validates a Realization without sending requests.
  • intent.connect(host, { provide? }) keeps committing trees and sends requests after successful acknowledgement.
  • connection.update(provide) changes context; disconnect() releases the host.
  • In React, reintentView shows a root, implement draws a catalog's kinds with the app's components, and useReintent changes and reads the root a component is in, or an Intent it names. useIntent and useIntentState are deprecated: useReintent does what they did.
  • Kinds declared in HostElements are lowercase tags, in Reintent's JSX and in React's.
  • intent.unload(of, true) marks an entity as held elsewhere, and useLoaded(of) lets the intent hold its place.

Last updated on

Edit on GitHub