In react , changing the state is immutable without the setState function. If we use setState function then the state value will be updated then the react re-renders the Component UI.