Skip to content

Commit 9c6257a

Browse files
committed
notes
1 parent 63c077d commit 9c6257a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

react/core/student-lesson-notes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ async function formAction(formData) {
8585
- 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.
8686

8787
```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+
8891
// useMemo calls the fn in the render phase (synchronously) and "memoizes"
8992
// the return value as x in this example based on the input of the dep array.
9093
// This is mostly used for:
91-
// 1. performance - memoizing the return value a function
94+
// 1. performance - memoizing the return value a slow function
9295
// 2. stabilizing objects and arrays that will end up in other dependency arrays
9396
// 3. stabilizing objects and arrays that will be passed as props to memoized components (see below)
9497
const x = useMemo(fn, [])

0 commit comments

Comments
 (0)