Problem Statement
Which higher-order component is used to avoid re-rendering functional components when props haven't changed?
Explanation
React.memo wraps a functional component and skips re-rendering if props are the same as before.
It is useful for optimizing list items or child components that receive frequent updates.
Code Solution
SolutionRead Only
export default React.memo(MyComponent);
Practice Sets
This question appears in the following practice sets: