Skip to content
Advertisement

Tag: usecallback

Why can’t `useCallback` always return the same ref

I don’t understand why useCallback always returns a new ref each time one of the deps is updated. It results in many re-render that React.memo() could have avoided. What is, if any, the problem with this implementation of useCallback? Using this instead of the built-in implementation sure has a significant positive impact on performance. Own conclusion: There is no reason

Advertisement