Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "updating" in React?

As React Documentation says:

componentDidUpdate() is invoked immediately after updating occurs

But I've noticed that componentDidUpdate() is invoked even a browser DOM element isn't updated.

So, what does the React Documentation mean by updating occurs?

like image 570
Roman Roman Avatar asked Nov 12 '18 15:11

Roman Roman


1 Answers

"updating" is not DOM updates only but is part of the life cycle.
It occurs when there are new props, state updates and force updates

You can see this part in this diagram taken from the DOCS

enter image description here

like image 123
Sagiv b.g Avatar answered Sep 30 '22 05:09

Sagiv b.g