For example, a component has the initial state of {loading: true, setup: true}
and when changing states like this:
this.setState({
loading: false,
setup: false
})
Are there any chances at one point that loading
is false
and setup
is still true
on the real DOM? Because as far as I know (correct me if I'm wrong), the process of updating through VDOM is the following:
- Add all the changes to
diff queue
- At 60FPS (through
requestAnimationFrame
), batch all the changes that are indiff queue
. Then apply all the mutations to the DOM in order.
Since we apply all the patches to the DOM in order, so I assume there will be a time where loading: false
and setup: true
?