0

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?

5

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.