But React is not without its flaws. That's why many developers turn to "alternatives" like Vue and Angular. But are these really "React alternatives"? I mean, even though all 3 share basic, general concepts like state and reactivity, they all differ vastly from each other. They aren't interchangeable and require you to take your time and adapt your mindset to the new tool.
Now, in this article, I'd like to present to you 4 of what I think are actual React alternatives. React-like libraries that are heavily inspired by the original version, with JSX, state, reactivity, and more goodness built-in - with some additional perks here and there.
Starting with the most obvious one - Preact. It's been around for a while now, and if you've ever looked for any React alternative you most likely have already seen it (it's one of the top results on Google). It's biggest advantages, when compared to React, are its performance and tiny size (4KB min+gzip). Now, sure - other alternatives on this list have even more impressive specs, but none of them come as close as Preact to React compatibility. Only with this library (with some help from additional compat module) can you get close to full compatibility.
So, to sum it up, Preact is a great option if you want to almost "magically" increase the performance of your React app. Being faster and smaller, while also highly compatible with React, Preact is somewhat like a drop-in replacement for a great many cases.
When compared to the likes of Preact, Hyperapp is a completely different beast. Rather than React compatibility, it focuses on being super lightweight and ultra-fast, while not requiring a compiler or bundler of any kind. That is unless you want to use JSX, which the library supports alongside simplistic state management and highly-optimized virtual DOM - all that in tiny 1.7KB (min+gzip) of code!
But if that sounds too minimalistic for you, there's still a couple of official "add-on" libraries for well-integrated functionalities like HTTP requests or timers. Additionally, with almost 18K GitHub stars and quite a big active community, you can expect many third-party tools, libraries, tutorials, and more (less so for freshly-released V2, but still).
Next up, we've got Crank.js, which is a fairly young open-source framework launched in the first half of 2020 and focusing heavily on asynchronicity and promises.
Lastly, we've got Solid, which is completely different from all previous listings. Similarly to Svelte, which you might have heard of recently, Solid combines JSX with a compiler!
Instead of doing its work at runtime like most UI libraries, Solid includes a compiler that processes your code, which results in heavily-optimized, ultra-lightweight, and crazy-fast web applications (that's a lot of positive adjectives right there). How fast you might ask? Well, fast enough to be one of the fastest UI libraries out there, competing with only a few - among which are vanilla JS implementations!
What's more, is that this speed doesn't come with any feature degradation. Thanks to its compiler-based approach Solid can easily support well-known React goodies like context, suspense, SSR, async rendering, and more without sacrificing on the resulting app's size (the compiler includes only what you use) or performance.
Now, sure, the Solid approach to development might require a small change of mindset for some, but if you need the best possible performance and smallest build size, without sacrificing development experience, Solid is a really solid choice. ;)
So, that's just a brief overview of some of these options. If you're interested in any of them - feel free to check out their respective websites, docs, and GitHub repos.
Anyway, feel free to let me know what you think of the current state of the JS ecosystem and all the UI libraries listed above in the comments below. Also, if there are any other interesting options that I missed, feel free to leave them there as well.
For more up-to-date web dev content, follow me on Twitter, Facebook, or through my newsletter. Thanks for reading and happy coding!