We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d79d19 commit fd32a3aCopy full SHA for fd32a3a
src/content/reference/react/memo.md
@@ -426,7 +426,6 @@ function Parent() {
426
// ... 返回语句 ...
427
}
428
```
429
-Since the name prop is always "John"
430
注意这些高亮行: 编译器会包裹 `<ExpensiveChild name="John" />` 在缓存里检查。由于 `name` prop 始终是 `"John"`, 这段 JSX 只创建一次,并在每次父组件重新渲染时重用。这正是 `React.memo` 的作用 - 当子组件的 props 没有变化时,防止其重新渲染。
431
432
React Compiler 会自动:
0 commit comments