Skip to content

Commit 740ce50

Browse files
committed
align to latest docs
1 parent 8b10a61 commit 740ce50

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/content/learn/you-might-not-need-an-effect.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ Generalmente, questo codice va bene! Ma forse `getFilteredTodos()` è lenta o ha
9595

9696
Puoi inserire in cache (o ["memoizzare"](https://en.wikipedia.org/wiki/Memoization)) un calcolo dispendioso con un Hook [`useMemo`](/reference/react/useMemo):
9797

98+
<Note>
99+
100+
[React Compiler](/learn/react-compiler) può memorizzare i calcoli dispendiosi automaticamente, rendendo `useMemo` non più necessario nella maggior parte dei casi.
101+
102+
</Note>
103+
98104
```js {5-8}
99105
import { useMemo, useState } from 'react';
100106

@@ -430,7 +436,7 @@ function Game() {
430436
// ✅ Calcola il prossimo state nell'event handler
431437
setCard(nextCard);
432438
if (nextCard.gold) {
433-
if (goldCardCount <= 3) {
439+
if (goldCardCount < 3) {
434440
setGoldCardCount(goldCardCount + 1);
435441
} else {
436442
setGoldCardCount(0);

0 commit comments

Comments
 (0)