Handling Deeply Nested Props
In this lesson, we'll discuss how to handle a component when nested props are used.
React.memo
does a shallow comparison of props. By implication, if you have nested props objects, the comparison will fail.
To handle such cases, React.memo
takes in a second argument, an equalityCheck
function.
Here’s a basic example:
Get hands-on with 1400+ tech skills courses.