Skip to content

Commit fd32a3a

Browse files
authored
Update src/content/reference/react/memo.md
1 parent 1d79d19 commit fd32a3a

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/content/reference/react/memo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ function Parent() {
426426
// ... 返回语句 ...
427427
}
428428
```
429-
Since the name prop is always "John"
430429
注意这些高亮行: 编译器会包裹 `<ExpensiveChild name="John" />` 在缓存里检查。由于 `name` prop 始终是 `"John"`, 这段 JSX 只创建一次,并在每次父组件重新渲染时重用。这正是 `React.memo` 的作用 - 当子组件的 props 没有变化时,防止其重新渲染。
431430

432431
React Compiler 会自动:

0 commit comments

Comments
 (0)