What is the role of React.memo in optimizing component rendering in ReactJS?


React.memo is a higher-order component similar to PureComponent that memoizes the rendered output of a component based on its props. It prevents unnecessary re-renders of functional components by caching the result and re-rendering only when props change.

Share This Story, Choose Your Platform!