| "Lots of people are still using it, but nobody can quite remember why." I can remember why. This, and every other article I've ever read arguing to replace React with Web Components, completely misunderstands the point of React. It isn't about JSX. It isn't about encapsulation. It isn't about reusability. It is about enabling a design pattern where *the user interface is a pure functional transformation of the application state.* I kind of feel like people get tripped up by the fact that "virtual DOM" and "shadow DOM" sort of sound similar. They have literally nothing to do with each other. The React "virtual DOM" allows you to *completely re-output the entire user interface* on every state change, which is not possible with any other design pattern, and is not possible without a framework, because actually re-rendering the entire tree on every state change isn't performative (or usable). Anybody who is advocating an alternative to React needs to do one of two things: (A) Make a convincing argument that a different design pattern is better. Some things we've tried, which most people think are worse: 1. Using the DOM as your data model (jQuery) 2. Manually writing virtual representations of every view (Backbone) 3. Auto-magically two-way binding some data structure with the DOM (Angular 1) 4. Observables (Ember, maybe Angular 2+?) (B) Advocate a framework other than React that uses the same pattern as React, but improves the usability. I think the two places there is the most room for improvements are: 1. Animations 2. useEffect() in general I have not seen anybody successfully do either A or B. Recommended reading: https://acko.net/blog/get-in-zoomer-we-re-saving-react/ |
Don't forget Knockout which was the OG. You can also make the case that Svelte, Vue, and Qwik all are different takes on Observables (at least as much as Angular 2+ is) all with more or less magic and more or fewer escape hatches from Observable best practices to imperative(-looking) code.
I got a "What if we did Knockout but with with the compile-time benefits of TSX and Pure RxJS Observables?" itch a couple months back and have made some wild progress on it. I certainly don't think it is ready yet to advocate as an alternative to React, but it's probably in an interesting A4+B2 tangent on your map right here, and I find that interesting.