Installation
npm add synstateOr with other package managers:
# Yarnyarn add synstate
# pnpmpnpm add synstateReact Hooks
Section titled “React Hooks”If you are using React, install the companion hooks package:
npm add synstate-react-hookssynstate-react-hooks includes all exports from synstate plus the createState, createReducer, and createBooleanState APIs extended for React, so you don’t need to add synstate along with it.
React Hooks (React 16.8–17)
Section titled “React Hooks (React 16.8–17)”For React 16.8–17 (without useSyncExternalStore), use the compat package instead:
npm add synstate-react-hooks-compatThe API is identical to synstate-react-hooks. See React Integration for details.
Preact Hooks
Section titled “Preact Hooks”If you are using Preact, install the companion hooks package:
npm add synstate-preact-hooks