nano-kit-react
Installation
SKILL.md
@nano_kit/react
@nano_kit/react binds @nano_kit/store to React: hooks that read signals, dependency injection through context, and hydration providers for SSR and React Server Components. Signals, stores, DI and hydration themselves are described in the nano-kit-store skill.
Reference
DOCS.md next to this file is the documentation of the released package as published on https://nano-kit.js.org, generated from the site sources. Read it for the hooks, providers and server components before writing code. This skill adds only conventions, choices and pitfalls.
Components
useSignal($accessor)subscribes the component; writing is a plain call of the signal, no hook needed.- Pass stable accessors. A computed or arrow function created during render is a new subscription on every render: create derived accessors in the store, or
useMemothem when they really depend on props. - Keep logic out of components: they read signals and call actions. Validation, derived values, loading and error states come from the store, usually through
@nano_kit/query. - Per-row state (selected, expanded) comes from a
selectorin the store; give each row a memoized accessor for its key. - Navigation and links come from
@nano_kit/react-routerhooks, not fromwindow.location.