Reatom JSX
Use this skill when implementing or explaining @reatom/jsx. Treat REFERENCE.md as the canonical reference bundled with this skill.
How to use
- Read the relevant sections of REFERENCE.md — do not assume React/Vue JSX semantics (no virtual DOM, no diffing, no component re-renders).
- For Reatom core (atoms, wrap, async, routing), use the
reatomskill. - For pull requests and skeptic validation, use
reatom-reviewplus this skill for JSX-specific patterns.
Section map
Use this map to open only the relevant parts of REFERENCE.md:
| Topic | Section |
|---|---|
| Install, tsconfig, Vite | Installation, Framework compatibility |
| Bootstrapping the app | Example, Hot module replacement |
| Props, children, bindings | Reference → Props, Children, Models |
| Inline and css-prop styles | Reference → style props, style:*, CSS-in-JS |
| Class names | Reference → class or className, reatomClassName |
| Components and lists | Reference → Components |
| Bulk prop binding | Reference → $spread |
| SVG and raw markup | Reference → SVG |
| Mount side effects | Reference → ref props |
| Errors, boundaries, jsxError | Error handling |
| Utilities | Utilities → reatomClassName, css, <Bind> |
| TypeScript | TypeScript |
| SSR and keyed lists | Limitations |
Implementation defaults
- Components are plain functions evaluated once at mount; use atoms and reactive props for updates.
- Reads: zero-arg atom call. Writes:
.set(...). on:*handlers that touch Reatom state are wrapped automatically; do not wrap manually in JSX.- Never reuse a JSX element instance in multiple places — call the component function or factory each time.
- Plain writable atoms:
model:value/model:checkedfor search, toggles, linked-list row atoms. - Real forms:
reatomFormfrom@reatom/corewith<form model={form}>andmodel:field={form.fields.x}— nevermodel:valueon field atoms (bypassesfield.change). - Form submit loader: style
[data-submitting]on the form (set automatically bymodel={form}); CSS-only spinner on[type='submit']::after. - For SPA navigation use
reatomRoute: links viahref={route.path(params)}, programmatic moves viaroute.go(params)— see thereatomskill Routing section. - Use
prop:*for DOM properties,attr:*for attributes when semantics matter. - Mount with
mount(root, <App />); callunmount()on teardown (including Vite HMR). Prefer@reatom/vite(reatom()plugin) so mount/route HMR dispose is automatic. - For dynamic lists, store elements in atoms or map inside reactive children — no keyed reconciliation.
- Isolate UI failures with
<ErrorBoundary fallback={...}>and lazy children{() => <Child />}; track globally viajsxError/addCallHook(jsxError, ...).
When REFERENCE.md and local examples disagree, prefer the reference and fix the example if it is wrong.