+1 vote
in ReactJS by

Why is a component constructor called only once?

1 Answer

0 votes
by

React's reconciliation algorithm assumes that without any information to the contrary, if a custom component appears in the same place on subsequent renders, it's the same component as before, so reuses the previous instance rather than creating a new one.

Related questions

0 votes
asked Jan 31, 2021 in ReactJS by Robindeniel
0 votes
asked Oct 7, 2019 in Android by pranay jain
...