fix(curriculum): typo in what is memoization and how does the useMemo hook work (#64946)

This commit is contained in:
Brian Tripp
2026-01-02 04:16:39 -06:00
committed by GitHub
parent bffbdcd90a
commit 09dff5b433

View File

@@ -96,7 +96,7 @@ function App() {
export default App;
```
The `timer` in the `useEffect`, running every second, will make the `calculateSquare` function runs any time it runs, even when you don't increase the `num` state variable.
The `timer` in the `useEffect`, running every second, will make the `calculateSquare` function run any time it runs, even when you don't increase the `num` state variable.
To solve this problem, we can use the `useMemo` hook by wrapping the function call in it and specifying the `num` variable as the dependency: