πŸ“Š React Js
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) Using the setter function returned by useState

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

Explanation by: Mr. Dubey
useState returns a state variable and a function to update it.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
70
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
88%
Success Rate