createClickHandler creates a new function every time it is called. Therefore, Button's parent creates a new function every time it is re-rendered, Button receives a different onClick prop every time its parent re-renders, and Button re-renders every time its parent re-renders, even if none of its other props change.

Senior front end engineer / charlesstover.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store