πŸ“Š React Js
Q. Which lifecycle method is equivalent to useEffect with an empty dependency array?
  • (A) componentDidMount
  • (B) componentDidUpdate
  • (C) componentWillUnmount
  • (D) shouldComponentUpdate
πŸ’¬ Discuss
βœ… Correct Answer: (A) componentDidMount

Explanation: useEffect with an empty array runs only once, just like componentDidMount in class components.

Explanation by: Mr. Dubey
useEffect with an empty array runs only once, just like componentDidMount in class components.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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