I've created a very simple example here..
https://codesandbox.io/s/react-memo-with-function-props-09fgyo
As you can see, ComponentB
renders just as many times as ComponentB
.. even though it's wrapped in memo
and isn't receiving counter
as a prop.
If you open up the app in it's own page (https://09fgyo.csb.app/) and then use React DevTools to profile the page, you'll see that it's reporting it's cause for rendering is because the onClick
prop changes: