React JS Memo

  • React.memo is a higher-order component (HOC) in React that memoizes a component, meaning it will only re-render if its props have changed.
  • This can improve performance by preventing unnecessary render calls, especially for components that are expensive to render.

Syntax:

In this example, MyComponent will only re-render if data changes.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top