React coverage
Each React API, and what brust does with it: lowered to native code, rendered once as static markup, or left to React as an island. Every row is a case the test battery builds and checks.
Summary
58 entries from the React reference (react.dev, fetched 2026-10-13): 12 native, 12 static, 24 island, 5 partial, 5 not applicable.
- Native: compiled to a template the server fills and a binding the browser updates; no React in the browser.
- Static: rendered once; the page ships the markup and nothing else.
- React island: the component runs in React, rendered by the worker and hydrated in the browser. The rest of the page keeps its tier.
- Partial: some shapes of the API are native or static and others are islands; the note says which.
- Not applicable: the API has no meaning in brust (there is no Server Components runtime).
Early returns and switch
A component body may choose what it returns with an early-return chain, if (a) return A and so on down to a last return, or with a switch on a prop, a state value or a member path such as item.type, when every case ends in return. Stacked cases (case 'a': case 'b':) and a default are fine, and a default may throw new Error with a literal message. Cases compare with ===, so the string '1' does not match the number 1. The tier follows the discriminant like any condition: props only keeps the page static, state makes the choice follow the clicks.
A switch that could fall through, leave with break, declare a const outside braces, or test something that is not a literal stays a React island, and the build names it switch-fallthrough. End every case with return to keep it native or static.
However long the chain, each case is printed once. Conditionals nested inside one another are different: a level that follows state, a store or a list row prints both of its branches, so what sits under it doubles. A component whose nested conditionals and lists print more than 8 MiB of such copies stops the build with reactive-if-depth, naming the component and the depth. Turn the nesting into one if / else if chain or switch, or compute the choice into one value first.
Lists
A list is items.map(callback) or Array.from(items, callback), where the callback returns JSX with a key. The item may be a name or a flat pattern, ({ id, name: label }) => or ([key, , value]) =>; the index, when there is one, is a name. The body may be one expression, or a block of const name = value; and if (cond) return null; statements before one return <li …/>. A row const may read the item, the index, props, state, the consts above it and helper functions.
brust does not keep a row const as a variable: each place that reads it reads its value. React computes the value once per row, brust where it is read, so a const read twice calls its helper twice. For a render that is pure and does not throw, the output is the same.
Four kinds of callback stay a React island, and the build names them list-shape with the reason: an item pattern with a default value, a nested pattern, a rest element or a computed key, or a pattern as the index; a row binding that is let, var or a pattern, or a const that holds JSX or calls a hook; an early return other than return null; and a row const read where a nested list or a function declares a name its value reads (rename that inner name). items?.map(…) stays an island too.
Component body and custom hooks
The component body may destructure a value with a flat pattern: const { kind, m: msg } = ask or const [first, , third] = pair. Over a path of props, state, a store view or another body const, each name reads its member of that path. Over anything else, such as a call, the value is computed once and each name reads its member of the result. A default, a nested pattern, a rest element or a computed key in the pattern keeps the component a React island, and the build names it body-shape with the reason. So does a destructured name read where a nested list or a function declares a name its value reads.
A custom hook may be imported through a module that only re-exports it: export { useX } from './x', import { useX } from './x'; export { useX } (renamed too) or export * from './x', up to four modules deep. Its module's other exports are then imported from the module that declares the hook. A hook parameter may have a default, such as function useFocus(selector = 'input', count?), when the default reads no other parameter and calls nothing: a call that leaves the argument out, or passes undefined, gets the default, as in React. A default that reads a parameter or calls a function keeps the hook-shape finding, which names the parameter.
Hooks
| Entry | Tier | Note |
|---|---|---|
useActionState | React island | any hook outside the supported hooks hook-unsupported |
useCallback | Native | |
useContext | Static | R34.142: a context with a literal default read as a value, with no Provider above the page, is its default (React's own rule) |
useDebugValue | React island | any hook outside the supported hooks hook-unsupported |
useDeferredValue | React island | any hook outside the supported hooks hook-unsupported |
useEffect | Native | effect-deps: the deps array is complete, so no warning () effect-deps |
useEffectEvent | React island | any hook outside the supported hooks hook-unsupported |
useId | Static | useId: the server seeds _id0 (); no state or handler, so the tier is static |
useImperativeHandle | React island | any hook outside the supported hooks hook-unsupported |
useInsertionEffect | React island | any hook outside the supported hooks hook-unsupported |
useLayoutEffect | Native | |
useMemo | Native | |
useOptimistic | React island | any hook outside the supported hooks hook-unsupported |
useReducer | Native | a state cell and one stable dispatch handler (was react, hook-unsupported) |
useRef | Native | |
useState | Native | |
useSyncExternalStore | React island | hook-unsupported |
useTransition | React island | startTransition is outside the supported set hook-unsupported |
Components
| Entry | Tier | Note |
|---|---|---|
<Activity> | React island | F148a: `mode` is an expression over props, which the server cannot hand to the island (fallback:island-prop). It read as static before only because the battery compiles without building: `brust build` failed it with ssr-prop-not-a-path (). With a plain prop or a literal mode it is a static page with the React built-in as an island (R34.21) external-component island-prop |
<Fragment> | Static | static fragment root: no <brust-host>, no warning (gaps L8) |
<Profiler> | Partial | native/static: d-profiler-bare; island: d-profiler external-component island-prop |
<StrictMode> | Static | R34.21 (F138e): the React built-in is an island and its constant children travel as JSON; the page was react only for island-children external-component |
<Suspense> | Partial | native/static: d-suspense-static; island: d-lazy-suspense dynamic-import external-component island-children local-component |
<ViewTransition> | Static | R34.21 (F138e): the React built-in is an island and its constant children travel as JSON; the page was react only for island-children external-component |
APIs
| Entry | Tier | Note |
|---|---|---|
act | Not applicable | A test helper; it has no runtime meaning in a brust page. Importing it changes nothing about a component. |
addTransitionType | React island | addTransitionType inside startTransition hook-unsupported |
cache | Static | cache() |
cacheSignal | Static | cache(): the call is a precompute job on the server |
captureOwnerStack | React island | captureOwnerStack in a handler hook-unsupported |
createContext | Partial | native/static: d-createcontext; island: d-createcontext-consumer member-tag jsx-const-child jsx-expression |
experimental_taintObjectReference | React island | hook-unsupported |
experimental_taintUniqueValue | React island | hook-unsupported |
lazy | React island | fixed: a dynamic import() is a dynamic-import fallback, not a printer panic dynamic-import external-component island-children local-component |
memo | Partial | native/static: b-memo; island: d-memo-state default-export-shape |
startTransition | React island | startTransition is outside the supported set hook-unsupported |
use | React island | hook-unsupported |
react-dom hooks
| Entry | Tier | Note |
|---|---|---|
useFormStatus | Partial | native/static: c-useformstatus-child; island: c-useformstatus; known gap: the root is static and Submit is an island, but the <form> is not a React form, so pending never becomes true; the root should be react hook-unsupported |
react-dom components
| Entry | Tier | Note |
|---|---|---|
<form> | Native | <form onSubmit>; known gap: a function action becomes a precompute value that the url_ok guard drops, so the form renders without an action and submits nowhere; it should fall back to react |
<input> | Native | controlled <input> |
<select> | Native | the shadcn wrapper shape; the value is printed as selected on the matching option |
<textarea> | Native | the value is printed as the text content |
<title> | Static | <title> in a component body |
<meta> | Static | <meta> in a component body |
<link> | Static | <link rel=stylesheet> in a component body |
<style> | Static | <style> element |
<script> | Static | <script async src> |
react-dom APIs
| Entry | Tier | Note |
|---|---|---|
createPortal | React island | jsx-const-child browser-global |
flushSync | Native | flushSync in a handler; known gap: compiles native but the client chunk imports react-dom (a native chunk must contain no react import); it should fall back to react |
preconnect | React island | preconnect in render body-shape |
prefetchDNS | React island | prefetchDNS in render body-shape |
preinit | React island | preinit in render body-shape |
preinitModule | React island | preinitModule in render body-shape |
preload | React island | preload in render body-shape |
preloadModule | React island | preloadModule in render body-shape |
Server
| Entry | Tier | Note |
|---|---|---|
'use client' | Not applicable | No directives: every component is classified by the compiler. The directive is ignored with a warning. use-client-leftover |
'use server' | Not applicable | No directives: server work is an Elysia app under `[actions]`, or a loader/job. A `'use server'` function is not a server function here. |
Server Components | Not applicable | No Server Components: a loader and the compiled jobs are the server half, components render to HTML on the Rust server. |
Server Functions | Not applicable | No Server Functions: call an `[actions]` route (`@brust/core/actions`) instead. |