Before updating the value of the state, we need to build an initial state setup. Once we are done with it, we use the setState() method to change the state object . It ensures that the component has been updated and calls for re-rendering of the component.24 Mar 2021