Question 5 of 10Pro Only
How does React.memo work? When should you use it and how do you write a custom comparison function?
Sample answer preview
React.memo is a higher-order function that memoizes a functional component. The component only re-renders if its props have changed, using shallow comparison by default. Basic usage is as follows.
React.memomemoizationshallow comparisonareEqualperformancepure component