You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: react/core/student-lesson-notes.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,10 +85,13 @@ async function formAction(formData) {
85
85
- React.memo (or just memo) is for memoizing function components so they get less re-renders. A memoized component will not be subject to re-rendering when the component above it (called the parent or owner component) re-renders unless the props being passed into the memoized component changes.
86
86
87
87
```js
88
+
// ✨ Note that the React Compiler (available as an option for React 19) can apply all three
89
+
// of these for you automatically.
90
+
88
91
// useMemo calls the fn in the render phase (synchronously) and "memoizes"
89
92
// the return value as x in this example based on the input of the dep array.
90
93
// This is mostly used for:
91
-
// 1. performance - memoizing the return value a function
94
+
// 1. performance - memoizing the return value a slow function
92
95
// 2. stabilizing objects and arrays that will end up in other dependency arrays
93
96
// 3. stabilizing objects and arrays that will be passed as props to memoized components (see below)
0 commit comments