InterviewHubPRO
Section Overview
Q162

Question 162 of 445

Part 8: Advanced React Patterns, Portals & Performance (152 - 261)

36%
React & Modern Frontend (445 Qs)•Part 8: Advanced React Patterns, Portals & Performance (152 - 261)

What is React memo function?

Class components can be restricted from re-rendering when their input props are the same using PureComponent or shouldComponentUpdate. Now you can do the same with function components by wrapping them in React.memo.

jsx
const MyComponent = React.memo(function MyComponent(props) {
/* only rerenders if props change */
});