Q. How can you optimize performance by avoiding unnecessary re-renders in React?
β
Correct Answer: (A)
Use React.memo for functional components and shouldComponentUpdate for class components
Explanation: These techniques allow React to skip rendering when props/state haven't changed.