A

Admin • 828.03K Points
Coach

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
  • Correct Answer - Option(C)
  • Views: 11
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin
React won't detect changes if state is mutated directly instead of using setState.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.