In class components, the method used to update the state is ________.

  • this.updateState
  • setState()
  • changeState()
  • modifyState()
In class components in React, the method used to update the state is setState(). This method is used to update the state object, and React then re-renders the component to reflect the new state. The other options are not valid methods for updating state in class components.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *