What State Management Library Should I Use with React?

preview_player
Показать описание
Do I need to use Redux? Should I just use React Context? This video will explain the past, present, and future of state management to help you make the correct decision for your team, project, or organization.

0:00 – Introduction
0:15 – History of React
0:50 – Flux Architecture
1:05 – Redux
1:31 – UI State
1:43 – Server Caching State
3:48 – Benefits of Separate Libraries
2:51 – React Context (useState / useReducer)
3:25 — State Management Today
3:41 — State Machines
4:17 — xState Demo
4:45 — Why are there so many state management libraries!?
5:52 — Immutable State
6:25 — Immer Demo
6:49 — URL State
7:33 — Performance issues with React Context
8:02 — useSelectedContext & Future
8:21 — State Management Suggestions
9:00 – Conclusion

Links
–––––

–––––
VSCode Theme: Sorcerer
Рекомендации по теме
Комментарии
Автор

My team and I just got a new project, and our team lead wanted us to make POC for different state management libraries. This video was extremely timely!

TheKurotsu
Автор

Jumping straight to XState makes one David somewhere in the world smiling

alvechy
Автор

Sent this video to a dozen devs. Great great explanation that I will be referencing for a long time.

benmitchinson
Автор

now that is called awesome! thanks for the great tutorial and a taste of history.

aaaliiiu
Автор

Thanks Lee for always having high quality videos with all the dense info in a very short time. I know it's not easy to edit a video like that and you probably need to repeat shooting parts multiple times. No "umm..." or "okay, let's wait for that to install"

pieter-venter
Автор

Hey this video is really useful for our community, thanks!

codersagora
Автор

Thank you for creating this video. It really helped me to understand react and state. I didn't know about the types of states in an app. For the past couple of weeks, i have been working on a project which requires fetching a lot of data in my next app. basically I wanted to create a dashboard. I wanted to reduce unnecessary API calls. Today I got to know about SWR. I knew about react query but never knew what it does. This video literally summed up everything. I am watching your videos for the past couple of days they are really helpful

mitejmadan
Автор

This is the best video I've seen on this topic. Thank you so much for all of the great info here.

cheeriozkitty
Автор

lol I said "it depends" in the same time haha, great video Lee thanks!

RYeah
Автор

Using zustand and immer with typescript. Never enjoyed doing state management so much before.

geralt
Автор

Such a great content but would like to see you create in depth videos for differnet state management lib or even intro to the upcoming useSelectedContext!

vs
Автор

Every project don't need heavy libraries like Redux/Recoil. Sometimes you just needs to create and consume global states. "react-rhino" is a library which does exactly the same with simple and straight forward syntax.

It uses Context API under the hood, but is very very simple than useContext.

aromal_anil
Автор

use react query to manage your server state. redux and other libraries are not ideal to manage server state lifecycles. react query handles caching, fetching, and updates asynchronous data. if you remove all the server state from redux or other libraries to react query, your global state becomes very thin.

ogbillity
Автор

fantastic video. also appreciate the excellent bookmarking 👍

frankybegue
Автор

Always great content
Thank you for all

domsbuhendwa
Автор

For small projects Redux is not needed, but as a project grows it may become necessary. The Context API is great for side and small projects, but may not be enough. I use Redux mainly, but I'm starting to use react-query for my fun/side projects. Appreciate your input Lee. See you soon!

CodingNuggets
Автор

would you only use a caching library like SWR if you don't expect the API results to change in the short term? for example, if you're fetching stock quotes, i would imagine you don't want to used the cached result from 2 minutes ago.

Daniel-veyr
Автор

Client state: Hookstate
Server state: React Query

I've reduced a ton of boilerplate-y code with those

Have fun

onurbamaro
Автор

Your thoughts on zustand? Great vid Lee

dacks
Автор

Thanks Lee! What state management solution can be used for keeping global state of websocket data coming from IOT sensors to dashboard?

mikkaruru
visit shbcf.ru