InterviewHubPRO
Section Overview
Q214

Question 214 of 445

Part 8: Advanced React Patterns, Portals & Performance (152 - 261)

48%
React & Modern Frontend (445 Qs)•Part 8: Advanced React Patterns, Portals & Performance (152 - 261)

Do I need to rewrite all my class components with hooks?

No. But you can try Hooks in a few components(or new components) without rewriting any existing code. Because there are no plans to remove classes in ReactJS.

Practical Code Example

text
// Do you need to rewrite class components?
// NO. Class components continue to work indefinitely. Use Hooks for all new components.