| A component function that runs on every render | compose(...enhancers)((props) => <jsx />): the enhancers run once on mount, the view once |
| Higher-order components, recompose | Enhancers: plain functions from the props so far to an Effect of more props |
useState | withUiState(name, Schema, initial) for screen state, a store for app state |
useEffect with a dependency array and a cleanup | withEffect(...): Effect code in the component's scope; cleanup is the scope closing |
useMemo, useCallback, memo | Not needed: nothing re-runs |
useContext | withStore(Store, ...) and services in the enhancers' requirements, provided at App.mount |
useQuery | withQuery(name, TheQuery, (props) => input) |
{cond && <X />}, cond ? <A /> : <B /> | <Show when={props.open}>...</Show> |
{items.map((item) => <Row key={item.id} />)} | <For each={props.items} by={(item) => item.id}>{(item) => <Row item={item} />}</For> |
useRef and ref | Handle.make and ref={handle} |
| Error boundaries | View.recover for expected errors (typed), View.crash for defects |
| Suspense | View.pending(Placeholder) |
| Portals | View.portal |
| React Router | Router.route, Router.outlet, router.link |
| Redux and middleware | Store.Tag, with async work as Effects on a service, and Outbox.channel |
| Testing Library | spar/testing (it uses the same queries by role) |