In react, props is an object of data that is unlikely to change in the lifecycle of the component, and state is data that is likely to change in the lifecycle of the component.
It helps create explicit rules for where developers should put things that do/do-not change.
React update pages very quickly by knowing exactly that data changes will either come strictly from a parent(as props) or come internally as state.
the exact function checks loosely if state/props are the same, then https://github.com/facebook/react/blob/master/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js#L881-L883
I'd recommend reading about how react "reconciles" data for changes and making updates to the dom. https://facebook.github.io/react/docs/reconciliation.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.