I noticed in React that when a component rerenders, its children also rerender even when their input properties did not change. So, in order to reduce rerenders I was reading this tutorial in which they improve this by exporting components as follows
export default React.memo(Child); In this scenario, the component Child only rerenders when its input properties change!
So my question is, should I always export my components like this? or are there situation in which this approach has side effects?
React.memois an optimization you should reach for only when you need it.