I wonder if useMemo
hook receives previous value for whatever it has memoized as any of the arguments to its callback?
Does a callback in useMemo receive any arguments?
No, The callback to useMemo
doesn't receive any arguments. It just relies on the array passed as second argument to execute the callback and return any result returned after executing the callback.
You can find a demonstration of this in codesandbox here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With