Hookstate is currently my favorite React state management library, even though it's the least popular in the group. It can pair especially well if you're using class-based components, has great docs, and decently-sized community. Maybe that's why it seems to be more focused on Angular (where Decorators are much more common) than it is on React.īut overall, if you like Akita and its API, nothing is stopping you from using it with React. So, with all the Functional Programming (FP) and hook craze going on right now, and the fact that Decorators aren't a stable JS feature yet, Akita might not be your jazz. Apart from Akita, MobX is the only library on this list that officially supports them, but even it has moved its focus to different approaches in v6. Now, while TypeScript isn't reserved for OOP and is wildly supported (most notably by all libraries on this list), Decorators are more of a niche feature. It's especially visible in its heavy use of TypeScript and Decorators. So, Akita differentiates itself through its OO approach. It's similar to MobX, but it diverts to a more Object-Oriented (OO) API, rather than the functional one like MobX. Next up, Akita is a bit of a lesser-known state management library. Try it on the sidelines, and keep an eye on its development (possibly even contribute to it) to see how things turn out. It's almost entirely the opposite! A modern atom-based approach to state management and fluid, hook-centric API do make it quite appealing.īut, right now because of Recoil's experimental stage, I'd recommend against using it in production-grade projects. It gained a lot of traction when it "launched" in an unstable phase at the beginning of this year, as a "Facebook experiment".Įven though it's still an experimental project, the fact that it's developed by people at Facebook (the birthplace of React), certainly helped boost its popularity, to a point where some people could even be using it in production right now.īut that doesn't mean that Recoil has nothing else going for it. Ok, so now we're getting into somewhat uncharted, but certainly a bit more interesting territory. And on top of that, you're also getting a noticeably smaller community and ecosystem. It's API is good and can lead to some really nice and clean code, but deep down it's a heavy library, that's pretty hard to master fully. But to give you the other side of the coin, MobX is certainly not for minimalists. There's still a noticeable learning curve for a library of this kind, but after that, it really feels nice and less repetitive than traditional Redux. Now, MobX is certainly not a small library, but when compared to Redux, some might find its API and observable approach a bit more pleasing. 2, MobX is an immensely popular, batteries-included state management library meant mainly (but not exclusively) for React. ![]() MobX MobX landing pageĪnother surprise, right? Similarly to Redux, but more like no. Still, Redux is the most popular of its kind, has the largest community and the biggest ecosystem, so it's not going anywhere anytime soon. Don't get me wrong - it's a great library, but its size, steep learning curve, and verbose action-reducer approach to state management can make some people want to switch. But it starts to "show its age" and if not that, then to irritate some devs. So, yes - Redux is de-facto "the default" of its kind. Sure, it's commonly bundled with React, but its core is independent and thus, it can be used with any UI library or framework. 1 when it comes to state management libraries for quite a while now. As always, I'll give you a brief description, and if it catches your eye, then be sure to check out the linked docs.Īnyway, let's dive in! Redux Redux landing page Some of them you almost certainly know, while others might surprise you. ![]() I have 5 options for you, in no particular order. I only brought this up because timing is quite important for the topic of today's post (as it might differ over time), which is a list of - in my opinion - top React state management libraries. So, less than 2 months left and 2020 will be over! What an amazing year this was, wasn't it? □Įnough of this sarcasm.
0 Comments
Leave a Reply. |