M

Mr. Dubey • 100.28K Points
Coach

Q. What will happen if a hook is used inside a conditional statement?

  • (A) It will work fine
  • (B) React will ignore it
  • (C) React will throw an error
  • (D) It will be skipped on first render
  • Correct Answer - Option(C)
  • Views: 18
  • Filed under category React Js

Explanation by: Mr. Dubey
Hooks must be called unconditionally at the top level of a function component.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics