πŸ“Š React Js
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) Runs when the component unmounts or before re-running the effect

Explanation: Cleanup helps avoid memory leaks and stale subscriptions.

Explanation by: Mr. Dubey
Cleanup helps avoid memory leaks and stale subscriptions.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
63
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate