Usestate

UseState is one of the React Hooks used to manage state in a component.

Normally, when we use a local variable, changing its value does not trigger a re-render of the component.

But useState allows us to store a value and update the UI whenever that value changes.

Using a normal variable doesn't trigger a re-render the UI still doesn't show anything about your process by using a normal variable.

To overcome this using usestate updates changes in UI everytime when the component gets re-rendered.

const [stateVariable, stateFunction] = useState(0);

Statevariable -It stored the current state value.

StateFunction - It is a setterfunction used to update the current state value. When called, it tells React to re-render the component so the UI can reflect the updated state.