DEV Community

Discussion on: A Quick Guide to React useCallback Hook

Collapse
 
savagepixie profile image
SavagePixie

Pretty much the same as when using useMemo, really. If you have a memoised component, a change it props will cause it to re-render. If any of those props happens to be a function, you can put it inside a useCallback to avoid re-rendering the memoised component on every render.

Collapse
 
monfernape profile image
Usman Khalil

Thank you for the explanation. I understand the concept. I am just not clear what impact does non-cached function makes on a component or DOM in general?