|
|
|
|
|
by repsilat
1041 days ago
|
|
> Bragging that you can't understand the difference between useMemo and useCallback after reading the docs (one is general memoization and the other is function-specific) Right, the first argument to useMemo must be a function, but the first argument to useCallback need not. That's what you meant, right? |
|
useMemo returns a value which is the result of calling the function it is given once the dependencies change.
So useCallback is basically useMemo called with a function that returns a function.