fix: typo in challenge solution (#7816)

This commit is contained in:
Ayman Alhourani
2025-05-17 14:07:49 -04:00
committed by GitHub
parent 0b68054c50
commit 65d297e93b

View File

@@ -1241,7 +1241,7 @@ export default function Timer() {
</Sandpack>
Instead of reading `count` inside the Effect, you pass a `c => c + 1` instruction ("increment this number!") to React. React will apply it on the next render. And since you don't need to read the value of `count` inside your Effect anymore, so you can keep your Effect's dependencies empty (`[]`). This prevents your Effect from re-creating the interval on every tick.
Instead of reading `count` inside the Effect, you pass a `c => c + 1` instruction ("increment this number!") to React. React will apply it on the next render. And since you don't need to read the value of `count` inside your Effect anymore, you can keep your Effect's dependencies empty (`[]`). This prevents your Effect from re-creating the interval on every tick.
</Solution>