跳到内容

特性

语法,关键字,和其他语言特性。
虽然这里没有什么大的惊喜,但有趣的是,Server ComponentsServer Functions 分别是第三和第四最不受欢迎的功能,这对于一套本应为 React 下一次向更完整的全栈框架演进铺平道路的新 API 来说,是令人不安的。

类别:

基准状态:

通过...分组:

根据此项排序:

01
Hooks
98.8%
3,166
02
Hooks
98%
3,177
03
主要 API
97.4%
3,665
04
Hooks
94.7%
3.8%
3,171
05
Hooks
93.6%
4.8%
3,180
06
Hooks
92.6%
5.9%
3,178
07
Hooks
91.2%
6.5%
3,187
08
主要 API
86%
7.9%
3.3%
3,701
09
主要 API
80.3%
15.1%
3.7%
3,644
10
主要 API
77.3%
14.8%
6.7%
3,667

经验

  • <span aria-hidden="true">🤓</span> 用过: 使用过此项目的受访者。
  • <span aria-hidden="true">👀</span> 有听说过: 听说过此项目,但没有使用过此项目的受访者。
  • <span aria-hidden="true">🤷</span> 没听说过: 从未听说过此项目的受访者。

情绪(态度)

  • 积极: 有兴趣了解此技术,或者愿意再次使用它的受访者
  • 中立: 未对此技术发表看法的受访者
  • 消极: 对此技术不感兴趣,或者使用此技术有糟糕体验的受访者

主要 API 随时间变化趋势

React 是一个成熟的库,这转化为其主要 API 的使用曲线相当可预测。
createContext
createPortal
forwardRef
<Fragment>
lazy
memo
<Profiler>
<StrictMode>
act

模式:

视图:

使用度:

使用过某个项目的受访者比例
0%
20%
40%
60%
80%
100%
2023
2024
2025
0%
20%
40%
60%
80%
100%

Hooks 随时间变化趋势

说到 hooks,useId 的采用率一直在迅速增长。虽然 useEffect 仍然是使用最多的 hooks API 之一,但它也是满意度比率最低的一个,证实了许多开发者对该 hook 挑剔的反应式模型的看法。
useCallback
useContext
useDeferredValue
useEffect
useId
useMemo
useReducer
useRef
useState
useSyncExternalStore
useLayoutEffect

模式:

视图:

使用度:

使用过某个项目的受访者比例
0%
20%
40%
60%
80%
100%
2023
2024
2025
0%
20%
40%
60%
80%
100%

新 API 随时间变化趋势

虽然 Server ComponentsServer Functions 的受欢迎程度都在缓慢增长,但 Suspense 是采用率最高的新特性。

它还拥有很高的满意度,遗憾的是,上述服务器 API 并非如此。

React cache
React Server Components
Server Functions
startTransition
<Suspense>
Taint API
use()
useFormStatus
useTransition
useActionState (formerly useFormState)
useOptimistic
<form> Actions
<ViewTransition>
<Activity>
React Compiler
useEffectEvent

模式:

视图:

使用度:

使用过某个项目的受访者比例
0%
20%
40%
60%
80%
100%
2023
2024
2025
0%
20%
40%
60%
80%
100%

主要 API 的痛点

forwardRef 长期以来一直是 React 开发者的心头大患,这就是为什么看到它在 React 19 中被弃用是如此令人欣喜的消息。
您在使用上述 API 时遇到过哪些痛点?
(自由提问)
多选
0%
20%
40%
60%
80%
100%
01
02
+1
03
Memoization issues
04
Excessive complexity
+1
05
Context API
-1
06
07
React issues
08
-1
09
测试
-1
10
Excessive boilerplate
+2
0%
20%
40%
60%
80%
100%
受访者百分比
React 开发者再一次清晰而响亮地表达了他们对 useEffect 的恼火。
您在使用 hooks 时遇到过哪些痛点?
(自由提问)
多选
0%
20%
40%
60%
80%
100%
01
02
Dependency Arrays
03
04
Excessive complexity
+1
05
React issues
06
-2
07
Excessive Re-rendering
-1
08
+1
09
状态管理 (useState, Redux, Context, 等等。)
-3
10
Rendering issues
0%
20%
40%
60%
80%
100%
受访者百分比

新 API 的痛点

正如之前的图表所预示的那样,受访者对 Server Components 有不少抱怨。
您在使用新 API 时遇到过哪些痛点?
(自由提问)
多选
0%
20%
40%
60%
80%
100%
01
React issues
02
Excessive complexity
03
Form issues
04
Server components
05
Build tools issues
06
Frontend and backend integration
-1
07
-1
08
09
+3
-11
0%
20%
40%
60%
80%
100%
受访者百分比
<ViewTransition> API 可能目前仅在 React Canary 中可用,但它已经在受访者中引起了极大的好奇,同样引起好奇的还有 <Profiler>
0%
20%
40%
60%
80%
100%
01
+3
1,370
02
999
03
994
-3
986
05
969
06
950
07
-4
941
09
-7
916
10
-2
893
0%
20%
40%
60%
80%
100%
受访者百分比
每个项目被添加到受访者阅读列表的次数,该功能可让受访者在参与调查时了解更多有关特定主题的信息。
The Complete Intro to React Course, v9
Brian Holt
Databricks

The Complete Intro to React Course, v9

Learn to build real-world apps with React 18 and React 19. Use tools like Vite, ESLint, and Prettier to scaffold a project and the latest React and TanStack features to build a complete e-commerce application.
A Tour of JavaScript & React Patterns
Lydia Hallie

A Tour of JavaScript & React Patterns

You’ll get an overview of more traditional design patterns with JavaScript, such as the Singleton and Proxy patterns. Then see React patterns such as the Hooks and Higher Order Component patterns.
感谢合作伙伴对我们的支持! 了解更多。