mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-26 07:25:20 +00:00
fix: typo in challenge solution (#7816)
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user