Things that look like React but are not
Behavior that is still being built is tracked in docs/STATUS.md; the router, SSR and integrations for a Next.js app are on the Next.js page.
- Reading state without calling it.
countis a function. In JSX,{count}works (a function child is an accessor), butcount + 1does not. Call it:count() + 1. - Early returns are not live. See Lists and conditionals.
- Hooks are not order dependent. A
useEffectinside anifis valid; hooks attach to the owner that is running, not to a slot. - Setting state in the body is allowed. The body is setup, not a render, so it does not loop.
import { memo } from "@shadow-js/web"is notReact.memo. It is the helper the compiler's output calls.- Props read once.
useStore(props.start)snapshots; use an effect that callssetValue(props.start)to sync. keyis not list identity on an element. It is accepted and ignored;<For key={...}>keys a list. NoStrictMode, no double invocation: nothing runs twice in development.- Context values are read once. Provide an accessor or a store for values that change.
- Module-level state is shared on the server. See the caution under Redux and Zustand.
Behavior that is still being built is tracked in docs/STATUS.md; the router, SSR and integrations for a
Next.js app are on the Next.js page.