Q. How do you prevent a component from re-rendering?

  • (A) Using shouldComponentUpdate in class components
  • (B) Using useEffect with empty dependencies
  • (C) Using React.memo for functional components
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: All listed techniques help in preventing unnecessary re-renders in various ways.
Explanation by: Mr. Dubey
All listed techniques help in preventing unnecessary re-renders in various ways.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
75
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
86%
Success Rate