Chapter 5 · Example 5 · Memoization with useMemo, useCallback and React.memo

Children as a prop

JSX children passed to a React.memo component are a non-memoized object that breaks the props check, so wrapping the child element in useMemo restores memoization.

Loading live editor…