What is the difference between React State and Javascript objects? when the state changes the dom changes automatically and when objects change the dom is also changed.
2 Answers
In React , The state object is where you store property values that belongs to the component. React is a javascript library so it uses javascript object as its state. In short React state is a javascript object .
When there is any change in the state via the setState func , then the DOM re-renders only to the specific part that has changed. Beauty of react , the virtual Dom.