Q. What happens if you call setState() inside render()?

  • (A) It updates the state normally
  • (B) It causes an error
  • (C) It causes an infinite loop
  • (D) It works once
πŸ’¬ Discuss
βœ… Correct Answer: (C) It causes an infinite loop
Explanation: Calling setState() in render() causes an infinite loop of rendering and state updates.
Explanation by: Mr. Dubey
Calling setState() in render() causes an infinite loop of rendering and state updates.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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