A

Admin • 833.24K Points
Coach

Q. What does the useEffect hook’s cleanup function do?

  • (A) Runs when the component unmounts or before re-running the effect
  • (B) Sets initial state
  • (C) Updates props
  • (D) Fetches data
  • Correct Answer - Option(A)
  • Views: 20
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

Cleanup helps avoid memory leaks and stale subscriptions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.