Skip to content

Commit 26b0eb2

Browse files
committed
typo
1 parent 9b5638f commit 26b0eb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/hooks-faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
343343

344344
This code calls `computeExpensiveValue(a, b)`. But if the inputs `[a, b]` haven't changed since the last value, `useMemo` skips calling it a second time and simply reuses the last value it returned.
345345

346-
**You may rely on `useMemo` as a performance optimization, not as a semantic guarantee.** In the future, React may choose to "forget" some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components. Write your code so that it still works without `useMemo` — and then add it to optimize performance. (For rare cases when a value must *never* recomputed, you can [lazily initialize](#how-to-create-expensive-objects-lazily) a ref.)
346+
**You may rely on `useMemo` as a performance optimization, not as a semantic guarantee.** In the future, React may choose to "forget" some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components. Write your code so that it still works without `useMemo` — and then add it to optimize performance. (For rare cases when a value must *never* be recomputed, you can [lazily initialize](#how-to-create-expensive-objects-lazily) a ref.)
347347

348348
Conveniently, `useMemo` also lets you skip an expensive re-render of a child:
349349

0 commit comments

Comments
 (0)