paint-brush
React Hooks: The Difference Between useMemo and useCallbackby@Sveta.Slepner
3,543 reads
3,543 reads

React Hooks: The Difference Between useMemo and useCallback

by Sveta Slepner4mSeptember 4th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

React library provides two built-in hooks to optimize the performance of our app: useMemo & useCallback. UseMemo and useCallback hooks can be confusing about when to use them both. A functional component is the same as the render function we used to have in class components. If a function is called inside the component, it will be re-evaluated, again and again, on every re-render. Only when one of the dependencies is changed, our function will be called again.

Company Mentioned

Mention Thumbnail
featured image - React Hooks: The Difference Between useMemo and useCallback
Sveta Slepner HackerNoon profile picture
Sveta Slepner

Sveta Slepner

@Sveta.Slepner

Frontend developer @ Cloudinary

Learn More
LEARN MORE ABOUT @SVETA.SLEPNER'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Sveta Slepner HackerNoon profile picture
Sveta Slepner@Sveta.Slepner
Frontend developer @ Cloudinary

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite