memoized component still re-renders on every parent update
I wrapped a child in React.memo but it still re-renders whenever the parent re-renders. We are on React 18.3. I pass a couple of props, one of them an inline object: <Child filters={{ status: 'open', page }} /> and an onChange={() => setOpen(true)}. I thought memo compared props shallowly and would skip. What am I doing wrong? I thought memo did a deep compare, which it very explicitly does not.
4 replies