安裝中文字典英文字典辭典工具!
安裝中文字典英文字典辭典工具!
|
- Jotai, primitive and flexible state management for React
Jotai takes an atomic approach to global React state management Build state by combining atoms and renders are automatically optimized based on atom dependency This solves the extra re-render issue of React context, eliminates the need for memoization, and provides a similar developer experience to signals while maintaining a declarative
- Documentation — Jotai
Welcome to the Jotai v2 documentation! Jotai's atomic approach to global React state management scales from a simple useState replacement to an enterprise application with complex requirements Features Minimal core API (2kb) Many utilities and extensions; TypeScript oriented; Works with Next js, Waku, Remix, and React Native; Core
- Jotai tutorial
Jotai atoms are small isolated pieces of state Ideally, one atom contains very small data Here's how you create your first atom
- Next. js — Jotai, primitive and flexible state management for React
Jotai provides SWC plugins for better DX while developing with Next js Find more info in the SWC section Examples Clock
- Comparison — Jotai, primitive and flexible state management for React
If you need React Context alternatives, Jotai comes with enough features If you need to read and write atoms outside React, Jotai provides store API If you would try to create a new library, Jotai might give good primitives
- Jotai tutorial
Quick start Examples Playground
- Async — Jotai, primitive and flexible state management for React
Async support is first class in Jotai It fully leverages React Suspense at its core Technically, Suspense usage other than React lazy is still unsupported undocumented in React 17 If this is blocking, so you can still use the loadable API to avoid suspending To use async atoms, you need to wrap your component tree with <Suspense>
- Jotai tutorial
Jotai is inherently leveraging Suspense to handle asynchronous flows < Suspense fallback = { < span > loading < span > } > < AsyncComponent > < Suspense > But there is a more jotai way of doing this with the loadable api present in jotai utils
|
|
|