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

Custom hooks break memoization

Passing a submit function returned from a custom hook to a React.memo child breaks its memoization, since the hook re-creates that function on every re-render.

Loading live editor…