DEV Community

Mariusz
Mariusz

Posted on • Edited on

3 1

React tldr; Optimize Components with React.memo, useMemo, and useCallback

  • With React.Memo, if a component returns the same result given the same props, wrapping it in memo can result in a performance boost.

  • useMemo allows you to memoize the results of a function and will return that result until an array of dependencies change.

  • useCallback can prevent unnecessary renders between parent and child components.

Source: https://headway.io/blog/react-optimize-components-memo-usememo-usecallback/

Top comments (1)

Collapse
 
9ec7c6077bc34b7 profile image
@dev_tusharahinave

intersted.. :)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay