paint-brush
The Difference Between useMemo and useCallback — An In-Depth Lookby@bluebirdyourdestiny
388 reads
388 reads

The Difference Between useMemo and useCallback — An In-Depth Look

by bluebirdyourdestiny3mSeptember 24th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A useMemo is called using React source code, while a useCallback is called by the user. UseMemo can be used to memoize expensive functions to avoid having to call them on every render. A variable of usememo contains only the result of the return, which means everything in the body of the argument function is ignored. Using useMemO is a straightforward React hook that takes no parameters and does not require a re-render count. Using a hook that manages the side-effects in functional components is a gamble, but using it is very likely a mistake.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - The Difference Between useMemo and useCallback — An In-Depth Look
bluebirdyourdestiny HackerNoon profile picture
bluebirdyourdestiny

bluebirdyourdestiny

@bluebirdyourdestiny

L O A D I N G
. . . comments & more!

About Author

bluebirdyourdestiny HackerNoon profile picture
bluebirdyourdestiny@bluebirdyourdestiny

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
Marble-cards