Which of the following hooks is used to manage local state in functional components?

  • componentDidMount
  • this.state
  • useEffect
  • useState
useState is the React hook used to manage local state in functional components. It allows functional components to maintain their state without using class components. useEffect is used for side effects and lifecycle methods like componentDidMount are used in class components, not functional ones. this.state is used in class components but not with hooks.
Add your answer
Loading...

Leave a comment

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