A

Admin • 833.24K Points
Coach

Q. How do you update the state in React functional components?

  • (A) Using the setter function returned by useState
  • (B) Directly assigning to the state variable
  • (C) Using this.setState()
  • (D) Using useEffect
  • Correct Answer - Option(A)
  • Views: 30
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

useState returns a state variable and a function to update it.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.