| > My point is that this sort of thing doesn't happen so lightly in other ecosystems. React has been around for 10 years (almost 11 since we're a few days away from 2024). Many of the ecosystems you're holding up as the epitomes of stability have had their fare share of large scale changes in that same time frame. Remember go before generics, or Rust before async landed [1]? Elixir's Phoenix didn't even have its first commit when React was released [2]. > there is no equivalent of useContext for class components Class components can still use context [3]. They obviously can't use the useContext hook, because class components aren't compatible with hooks, but that's kind of a tautology. > you didn't have to use ReactHooks, but try using Apollo client or react-query without them now, or try finding any non-hooks documentation in general. Library authors moved to hooks because sharing stateful logic was difficult before hooks. I never bought into the GraphQL hype train, but I remember there being a ton of verbose render props necessary to make GraphQL libraries like Apollo work before hooks. I don't think anyone really complained about data fetching libraries adopting hooks. You could argue that the react devs should have created the perfect library in 2013 complete with hooks, but I can forgive them for not having perfect foresight. Like I said, if an API changes occasionally over a decade I'm ok with it. Technology should be stable, not frozen. [1] https://areweasyncyet.rs/ [2] https://groups.google.com/g/phoenix-talk/c/l8kIhc_LC7o [3] https://legacy.reactjs.org/docs/context.html#classcontexttyp... |
"React" has been around for 10 years but in practice its been 3.5 different frameworks
- the original
- the class version (still close enough to original)
- hooks version (largely a whole different concept and "compatible" only superficially while the rest of the ecosystem starts writing incompatible things)
- server components, and `use`, which monkey patch fetch and already broke half of the ecosystem.
And no, hooks are still far from perfect and are infact very unintuitive and awkward to pretty much anyone who hasn't used React.
Additionally, there were designs possible to evolve from class components, its just that the React team cared more about
- "innovation",
- "functional" aesthetic preferences
- enabling a DCE compiler
rather than compatibility and continuity
Example design that would prioritise compatibility and continuity while still enabling all the current features of hooks: https://news.ycombinator.com/item?id=35192312
Again, this is _not enough_ attention to backward compatibility and stability in other ecosystems, even older ones like Python.