logoalt Hacker News

esperentyesterday at 5:02 AM1 replyview on HN

> So class components are still first class citizens

Yes

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

> play well with existing ecosystem code?

That's not something the React team has any control over so it feels like an unfair complaint.

However, besides external libraries that are specifically designed to work with hooks, I'd say quite a lot of things would still work. And you can always just use older versions of things, nobody is forcing you to upgrade.

Anyway, React has been using hooks for about 6 or 7 years now. Not quite the ten years claimed in the previous comment but not so far off either.


Replies

jakelazaroffyesterday at 5:23 AM

> That's not something the React team has any control over so it feels like an unfair complaint.

Sure it is — they could let you run hooks from within class components. Not only do they not allow that, they actively discourage you from writing class components in the documentation.

Even if they didn’t have control over that, though, how does the complaint feel unfair? When I buy into a tool, I’m buying into the ecosystem as well. If the ecosystem moves in a direction I don’t like, that’s a strong disincentive to using that tool!