useCallback(function, [dependecies])
Enter fullscreen mode
Exit fullscreen mode
useCallback is one of the new featu...
For further actions, you may consider blocking this person and/or reporting abuse
I think it's worth pointing out that using useCallback can actually make your app even slower and may damage performance: dmitripavlutin.com/dont-overuse-re...
So the function is still created on a re-render, it just returns the same function reference as before. Therefore I think this article may be a bit misleading to readers thinking they should always implement useCallback().
typo: it Returns a
memoizedmemorized
callback.No,
memoized
is the correct word: en.wikipedia.org/wiki/MemoizationNeither of you was correct. Memo is not a real word. It's short for memorandum, so it should be memorandumization. If you're going to spell it with memo, then at least include a hyphen: memo-ization.
Neither of you was correct. Memo is not a real word. It's short for memorandum, so it should be memorandumization. If you're going to spell it with memo, then at least include a hyphen: memo-ization.
Nice article but I missed the answer to this comment from React docs:
The array of dependencies is not passed as arguments to the function. Conceptually, though, thatโs what they represent: every value referenced inside the function should also appear in the dependencies array.
So it's not clear is it a dependency array or is it an array for cache'ing control.
The thing is, that all those useCallbacks work with empty array `[]` and from this point, it's not the dependency array.
Clean and simple.
Good Job!
Excellent explanation thanks