Q. What happens if you update state directly in React?

  • (A) React throws an error
  • (B) It updates the component correctly
  • (C) The component won’t re-render
  • (D) It updates all components
πŸ’¬ Discuss
βœ… Correct Answer: (C) The component won’t re-render
Explanation: React won't detect changes if state is mutated directly instead of using setState.
Explanation by: Mr. Dubey
React won't detect changes if state is mutated directly instead of using setState.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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