mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-16 22:00:28 -05:00
fix(curriculum): typo in what is memoization and how does the useMemo hook work (#64946)
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user