Should you still be using Redux in 2023?

preview_player
Показать описание
Redux is still a massive force in the web development industry, and it's not going anywhere. It's got a pair of extraordinary maintainers, Mark and Lenz, a huge ecosystem of plugins and one of the best documentation sites out there.

00:00 Intro
00:29 How does Redux work?
01:00 Actions
01:49 Subscriptions
02:22 One store
02:38 Slices
03:02 Popularity
03:31 Context API !== Redux
04:43 Evolution
05:41 Legacy Redux
06:35 Would I use it?

Become a TypeScript Wizard with my free beginners TypeScript Course:

Follow Matt on Twitter

Join the Discord:

Рекомендации по теме
Комментарии
Автор

One of the best videos on web dev that talk about a technology: to the point, clear, and explains the why and the hows to someone who is new to the topic. Amazing!

XxXgabbOXxX
Автор

You forgot to talk about Redux Toolkit Query / RTK Query.

Its a data fetching and caching library that works seamlessly with Redux toolkit. Its basically Redux's answer to React Query. Super useful if you don't want to break out of Redux's patterns while also not having to worry about doing the heavy lifting of caching your own data.

wlockuz
Автор

Zustand all the way baby. Gotta go fast!

ChillAutos
Автор

Many times you want the state on the server, which makes react-query a better solution. In your user example the leaf components would send a mutation to the server, and the updates would be handled by react-query's caching mechanisms.

But looks cool :)

YTCrazytieguy
Автор

just watched like 4 straight videos from you and i'm pretty sure my neck hurts from continuous nodding in agreement. you always have great takes

MagerX
Автор

Wow. I wasn't aware that Redux had resolved so much. I was firmly stuck in seeing it implemented in a project around 2017 or so I think. It seemed incredibly boilerplatey as you say, and complex. I will look back into it again.

havokgames
Автор

I'm using Redux Toolkit in my React Native app, it was a bit clunky to get set up and used to but I'm happy with it and it's modularity so far.

YOitsBA
Автор

Is Redux still relevant in 2023?

No. Unless you have a huge app with a lot of client side state like a video editor app, ui design app like figma, etc.
In 2023 and beyond just use React Query for all your async server state and React Context or Zustand for the little global state that is left.

Redux should be only be considered on VERY specific cases.

guiiimkt
Автор

Many people finds react-query with zustand or jotai a good replacement of redux.Yes redux is hard to setup but as your app grows, the structure of redux will make testing a lot easier

bideshbanerjee
Автор

Sounds like modern React's-redux and Vue's-Pinia are pretty much drinking from the same special sauce..

ColinRichardson
Автор

sure, context doesn't replace redux, but what about context + useReducer?

FunctionGermany
Автор

I feel like people who vehemently hate on redux at every opportunity only used the old crap syntax (with mapStateToProps and mapDispatchToProps), the new hook solution is much nicer to work with

BalintCsala
Автор

Using libraries for such simple things as managing state always kept me away from using them. I always wrote my own classes for that and used dependency injection to populate them through the component tree.

I must admit that I got a strong java background and started with angular in the frontend, moving slowly to typescript, expressjs, nestjs and vue / react as my techstack of choice.

Unfortunately I still do not get the benefits from using a library such as redux over simple stateful objects (except for debugging purposes using devtools).

davidadamson
Автор

Great insight, I used and taught both Redux and Redux Toolkit, I still feel like for beginners, It’s bit confusing but I always start with the importance of keeping one source for truth in you app and I show them examples of how bad things can go if you don’t have that. I feel like people want understand WHY, Why is it so boilerplaty!

DuraanAli
Автор

I don't even use any other libraries. 👀 I just use React Context + React Query. And these cover almost everything I've ever had to do in my projects. Would wanna know if this isn't the best practice. Why is context never mentioned when talking about state management? Is it not good or there's something else?

saad
Автор

Love the thumbnail lol, amazing vid, thanks as always Matt

krantinebhwani
Автор

MobX State Tree is often nicer to use imo.
But i must say, the way svelte handles this with stores is far less boilerplatey

doxologist
Автор

Great channel and how clam your explaining me great 👍

godofwar
Автор

Omg, someone said the same things I've been saying this whole time!

Saturn
Автор

Thank you so much for this video. That’s true a lot of things are said around redux but your explanations and point of view are very helpful. Great video, as usual!!!

christopheanfry