React Hooks: The Difference Between useMemo and useCallbackby@Sveta.Slepner
3,454 reads

React Hooks: The Difference Between useMemo and useCallback

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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


Receive Stories from @Sveta.Slepner

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa