Q. What is the default behavior of setState in class components?

  • (A) It merges the new state with the existing state
  • (B) It replaces the entire state object
  • (C) It immediately updates the state synchronously
  • (D) It triggers a full page reload
πŸ’¬ Discuss
βœ… Correct Answer: (A) It merges the new state with the existing state
Explanation: setState merges the provided object with the current state asynchronously.
Explanation by: Mr. Dubey
setState merges the provided object with the current state asynchronously.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
93
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate