React Memo in react
React.memo is a Higher-Order Component (HOC) that optimizes performance by preventing a functional component from re-rendering if its props are the same as before. It uses a 'shallow' comparison by default. It's best used for components that render often with fixed props, reducing total render cycles significantly.
Example
const MyComponent = React.memo(({ data }) => (
<div>{data.label}</div>
));