How do you say that state updates are merged?
- By using setState()
- By using forceUpdate()
- By using Object.assign()
- By using the spread operator
In React, state updates are merged with the existing state using the spread operator. When setState() is called, React updates the state object by merging the new state object with the existing state object. This allows components to update specific properties of the state object without overwriting the entire object.
Loading...