Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They're very much not "best practices", and will be deprecated soon (if they're not already).


You still can't add features like error boundaries in React without class-based components somewhere in your app. Even if they added these features to functional components today, it would be years before they'd consider them safe to remove.

HOC still exist and builtin features like `React.memo(MyComponent)` along with the like of more functional styles means they aren't ever going away.


But they're not deprecated. Where's the forced churn?

Every place that I've been at has made the gradual shift to migrate stuff away from class components as new stuff gets built or refactored. Seems like a pretty common development habit.


I'm not aware of any indication that class components will be deprecated.


That's not true (the deprecation part, anyway) and I know of at least one React team member who has spoken publicly to that fact.


Mea culpa: they’re not being deprecated. But the existence of custom hooks removes the bulk of (if not all of) their utility, and make it much easier to reason about code and make your code well-typed.


I have no idea why you are getting downvoted for this comment when there is literally a massive warning on the docs page for class components.

https://react.dev/reference/react/Component




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: