4 ms·
I'd argue that React is pretty much the same now as it always has been. The ecosystem has matured and grown for sure but even the basic API has remained pretty
by adzm 4y ago
I'd argue that React is pretty much the same now as it always has been. The ecosystem has matured and grown for sure but even the basic API has remained pretty much stable.
- brundolf 4y agoHooks didn't exist yet, for one, as mentioned in the Dan Abramov quote at the bottom: > we’re adding a stateful function API as a preferred alternative to classes soon Class components were the focus at the time, and are now all-but-deprecated. Also, Redux was still very popular in practice, which it isn't so much now (partly due to hooks) That's a pretty big change in the way people use React, which certainly informs a discussion like this
- acemarke 4y agoI'd have to disagree with this on a couple levels. Yes, hooks change the way we write React code in some ways, but in a lot of other ways nothing has changed. We still write components that accept props, have state, and return UI descriptions as JSX elements, and those components may cause side effects after a render is completed. Conceptually, the core principles of React are still exactly the same, and hooks didn't change that. Additionally, Redux is still by far the most widely used state management tool for React apps. My rough estimates are that 45-50% of React apps use Redux, whereas Mobx and XState are around 10-15%. I'll agree that Redux is not as "popular" as it once was, which is due to a number of factors. It was heavily overused early on, and the ecosystem has expanded to include a lot of other great tools that overlap with some of the use cases for Redux. But, "modern Redux" with Redux Toolkit is much easier to learn and use than the legacy hand-written patterns, and we get highly positive feedback on a daily basis from folks who tell us they enjoy using RTK. (In fact, RTK by itself has more downloads than Mobx, XState, or React Query.) So, that tells me Redux will continue to be widely used for a long time.
- pcthrowaway 4y ago> My rough estimates are that 45-50% of React apps use Redux, whereas Mobx and XState are around 10-15% Curious how you arrive at these estimates? I would have thought fewer than 30% of React apps started in the last year or so use Redux, but of course, many still do, perhaps a higher percentage of apps that were built >2 years ago do (you could argue these are more mature, so they've "grown into" redux, though you could also say they're legacy and preceded newer React capabilities and tooling) I don't have a strong inclination one way or the other, and have been toying with introducing Redux (or some other kind of state management) for the app I work with, but my understanding from the general sentiment of the threads/projects I follow is that market share of Redux has fallen in the last year or 2.
- azemetre 4y agoJust looking at download trends redux is literally in a class of its own. What I do wonder is how often people are abusing context, state, and reducers to make their own terrible state managers rather than using redux? I bet that number is higher haha. https://npmtrends.com/mobx-vs-redux-vs-xstate https://npmtrends.com/mobx-vs-redux-vs-xstate
- acemarke 4y agoGood question! The really short answer is: mostly looking at NPM download stats, Github "depended by" numbers, and random polls on Twitter. Which are all _horribly_ flawed metrics, but they're also all we have to go by. I wrote a couple longer comments on Reddit a while back that went into more details on some of the numbers and the potential flaws in using them: - https://www.reddit.com/r/reactjs/comments/lcgqnd/state_management/glzrax4/ https://www.reddit.com/r/reactjs/comments/lcgqnd/state_manag... - https://www.reddit.com/r/reactjs/comments/skbyb1/the_most_popular_react_tech_stack_in_professional/hvlwdpw/?context=3 https://www.reddit.com/r/reactjs/comments/skbyb1/the_most_po... and unfortunately you asking me about this is tempting me to turn those comments into a blog post with some additional thoughts :) (I.... may actually try to do that tonight or tomorrow. If you're interested, keep an eye on my blog at https://blog.isquaredsoftware.com https://blog.isquaredsoftware.com .) I'll definitely agree that Redux usage has peaked in _relative_ terms, although as you can see from the download numbers it seems to still be growing in _absolute_ terms. Also it's entirely possible that fewer new projects are choosing Redux. Then again, how do we even count "usage" in the first place? I've seen Web3 app boilerplate repos that include Redux Toolkit. If 1000 people clone that repo and play with it, how do we compare that usage conceptually vs one app using Mobx that's been around for years and has a bunch of developers working on it daily? As I've pointed out in a number of podcasts and articles: I'm not trying to convince people they _must_ use Redux, or even that they _should_ use Redux. I just want people to be aware that modern Redux is way easier than legacy Redux, that Redux _is_ still widely used and is a viable choice, and what some of the tradeoffs are when using Redux or any other state management library. I've actually been trying to get the community to come together and work on a centralized site that would list tools in different use cases and categories such as state management, styling, data fetching, and build tooling, describe purpose / use cases / tradeoffs for each tool, and have that as a recognized resource for people to use when researching what to use for a project. You can see the original RFC discussion and prototype site here: - https://github.com/markerikson/react-community-tools-practices-cheatsheet/discussions/1 https://github.com/markerikson/react-community-tools-practic... - https://react-community-tools-practices-cheatsheet.netlify.app/state-management/overview https://react-community-tools-practices-cheatsheet.netlify.a... Sadly I haven't had time to push this forward, and it needs to have more people involved and helping fill out content on the various topics (not just me).
- jacobr 4y agoIf your goal is to increase RTK adoption, rather than being reactively defensive whenever someone writes something remotely negative about Redux, may I suggest focusing on the highly positive feedback you mention? Writing up case studies on how RTK helped solve concrete problems, instead of being summoned anytime someone is wrong about Redux on the internet… Anyone judging Redux differently if it has a 15% or 45% market share is making decisions based on the wrong parameters anyway.
- acemarke 4y agoI've debated throwing together a docs page with a bunch of quotes and links to people saying how much they enjoy using RTK, but I've got enough other stuff on my plate that it hasn't been a priority.