跳到内容

状态管理

用于管理应用程序状态的工具库。

状态管理随时间变化的比重

Zustand 证实了其在积极性方面的领先地位,只有默认的 useState 得分更高。在使用率方面,Zustand 也有所增长,在过去一年中从 28% 上升到 41%!

Jotai
MobX
Recoil
Redux
Redux Toolkit
useState
XState
Zustand
Effector

模式:

视图:

0%
20%
40%
60%
80%
100%
2023
2024
0%
20%
40%
60%
80%
100%

其他状态管理工具库

虽然 TanStack Query 以数据加载库而闻名,但它在管理结果状态方面也做得很好。

0%
20%
40%
60%
80%
100%
1

2

3

4

5

6

7

8

9

10

11

12

13

其他答案

匹配“其他答案”的答案 245
0%
20%
40%
60%
80%
100%
受访者百分比
What other libraries have you used to manage state in your apps?
(自由提问)
我们邀请 React 社区成员分享他们的"年度之选"

我的 2024 年度之选: Remotion

在 React 中创建可编程视频的想法一直让我着迷。Remotion 是一个相对低调的项目,它在稳步缓慢地发展,已经成功地被开发者关系、教育工作者、独立创作者和大公司(特别是 GitHub 的 Unwrapped 视频活动)所采用。
我们邀请 React 社区成员分享他们的"年度之选"

State Management Pain Points

状态管理作为一个整体仍然过于复杂,特别是 Redux 在受访者中受到的批评很大。

0%
20%
40%
60%
80%
100%
1

Excessive complexity

2

Redux issues

3

Excessive boilerplate

4

Excessive re-renderings

5

Global state management

6

Synchronization issues

7

Performance

8

9

Excessive verbosity

10

MobX issues

0%
20%
40%
60%
80%
100%
受访者百分比
What pain points have you encountered related to state management?
(自由提问)
Advanced Redux with Redux Toolkit
Steve Kinney
Temporal

Advanced Redux with Redux Toolkit

In this course, you'll use Redux Toolkit to simplify reducer logic and actions, use TypeScript with Redux, add tests, and use RTK Query to fetch data in real-world projects.
State Modeling in React with XState
David Khourshid
Microsoft

State Modeling in React with XState

In this course, we'll be learning to model state before we code using state machines and statecharts and then use those in our app to orchestrate complex app logic.
感谢合作伙伴对我们的支持! 了解更多。