What happens when you call set state?

The state allows React components to change their output over time in response to user actions, network responses, etc, without violating their rules . It can be initialized in the constructor of a React component and afterward, can be accessed via the React component’s class instance with the this object.

Read more

What is the set state?

setState() allows you to change state in a React class component . To change the state of a function component, you use the useState() hook. Learn more about it here. setState() enqueues change to the component state and tell React that this component and its children need to be re-rendered with the updated state.

Read more