- Core Features
- Small, fast and scalable state management solution using simplified flux principles
- Store is a hook that can contain primitives, objects and functions
- State must be updated immutably with set function merging
- Components re-render only on state changes
- Advantages
- Simple and un-opinionated API based on hooks
- No context providers needed
- Can inform components transiently without re-rendering
- Less boilerplate than Redux
- Advanced Features
- Supports multiple state slices with strict equality detection
- Allows overwriting state model with set(false)
- Includes Redux DevTools integration with separate store connections
- Provides persist middleware for data storage
- Usage Notes
- Not recommended for React Server Components
- Can be used without React dependency
- Supports TypeScript with create<State>() syntax
- Includes Immer middleware for reducer-free state management