What State Management Library Should I Use with React?

  Рет қаралды 53,514

leerob

leerob

Күн бұрын

Пікірлер: 79
@TheKurotsu
@TheKurotsu 3 жыл бұрын
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!
@alvechy
@alvechy 3 жыл бұрын
Jumping straight to XState makes one David somewhere in the world smiling
@benmitchinson9831
@benmitchinson9831 3 жыл бұрын
Sent this video to a dozen devs. Great great explanation that I will be referencing for a long time.
@aaaliii4u
@aaaliii4u Жыл бұрын
now that is called awesome! thanks for the great tutorial and a taste of history.
@pieter-venter
@pieter-venter 3 жыл бұрын
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"
@codersagora9837
@codersagora9837 3 жыл бұрын
Hey this video is really useful for our community, thanks!
@leerob
@leerob 3 жыл бұрын
Thank you! Glad you found it useful.
@geralt36
@geralt36 3 жыл бұрын
Using zustand and immer with typescript. Never enjoyed doing state management so much before.
@mitejmadan8672
@mitejmadan8672 3 жыл бұрын
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
@leerob
@leerob 3 жыл бұрын
I really appreciate this comment. Glad I could help!
@MightyKingKala
@MightyKingKala 2 жыл бұрын
Great video!
@vs599318026
@vs599318026 3 жыл бұрын
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!
@ogbillity
@ogbillity 3 жыл бұрын
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.
@cheeriozkitty
@cheeriozkitty 3 жыл бұрын
This is the best video I've seen on this topic. Thank you so much for all of the great info here.
@RYeah100
@RYeah100 3 жыл бұрын
lol I said "it depends" in the same time haha, great video Lee thanks!
@ashishshinde7070
@ashishshinde7070 2 жыл бұрын
Excellent👍
@frankybegue9492
@frankybegue9492 3 жыл бұрын
fantastic video. also appreciate the excellent bookmarking 👍
@roobannadarajah7989
@roobannadarajah7989 3 жыл бұрын
Who can dislike this. Cheers buddy
@Daniel-ve8yr
@Daniel-ve8yr 3 жыл бұрын
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.
@aromal_anil
@aromal_anil 3 жыл бұрын
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.
@domsbuhendwa924
@domsbuhendwa924 3 жыл бұрын
Always great content Thank you for all
@yilmazbingol4838
@yilmazbingol4838 2 жыл бұрын
great explanation.
@RickRyan26
@RickRyan26 3 жыл бұрын
Great vid!
@kristiankramas5944
@kristiankramas5944 3 жыл бұрын
Wow. This was great.
@stej2248
@stej2248 Жыл бұрын
Hi, I am using pullstate which is very very easy while comparing all other global state management for react of redux, recoil, jotai etc. Is it good to use pullstate? Since I am a beginner i am finding difficult to choose the global state management.
@minhquanma
@minhquanma 3 жыл бұрын
thumbs up for Schiit Stack behind
@okidokiyowyow356
@okidokiyowyow356 3 жыл бұрын
Can I ask whats your react stack? Like what library do you use/like?
@mikkaruru
@mikkaruru 3 жыл бұрын
Thanks Lee! What state management solution can be used for keeping global state of websocket data coming from IOT sensors to dashboard?
@CodingNuggets
@CodingNuggets 3 жыл бұрын
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!
@dacks22
@dacks22 3 жыл бұрын
Your thoughts on zustand? Great vid Lee
@leerob
@leerob 3 жыл бұрын
Thank you! The Zustand authors seem to be recommending Valtio now: twitter.com/dai_shi/status/1358568517100920832
@rakeshpaul5691
@rakeshpaul5691 3 жыл бұрын
@@leerob didn’t know about Valtio. I was using zustand + immer for one of my projects. I also found recoiljs very similar to zustand
@ricardocoutinho6183
@ricardocoutinho6183 3 жыл бұрын
What do you think about recoilJs?
@leerob
@leerob 3 жыл бұрын
4:45 😁No strong opinion other than it works well for certain use cases.
@ГенаПетров-н5ы
@ГенаПетров-н5ы 3 жыл бұрын
What library best for figma like app?
@erickgeneric
@erickgeneric 3 жыл бұрын
Wow. I’m going to have to try swr 😳
@moniruzzamansaikat
@moniruzzamansaikat 3 жыл бұрын
thanks for such a video
@jdratlif
@jdratlif 3 жыл бұрын
I think only components that have useContext and their children rerender, not every component under the context provider.
@onurbamaro
@onurbamaro 2 жыл бұрын
Client state: Hookstate Server state: React Query I've reduced a ton of boilerplate-y code with those Have fun
@mazenfayez5824
@mazenfayez5824 2 жыл бұрын
hello, did you try zustland? would like to here your thoughts, i think it is the simplist one so far.
@renegadeace1735
@renegadeace1735 2 жыл бұрын
What's so bad about prop drilling? Verbose yes, but clear and easy to understand, also yes!
@sleepysud
@sleepysud 2 жыл бұрын
Makes it painful to maintain / re-write code.
@Ace_Qnemes
@Ace_Qnemes Жыл бұрын
Go make something bigger than todo list and you`ll find out
@unmy400
@unmy400 3 жыл бұрын
I'll write this while i'm still watching the video, so i'll comeback later if the answer is in the video How SWR data that was fetched from an API is available to all my components as a global state? or it is that it doesn't make a fetch to an specific route if it was called previously by another component 🤔
@leerob
@leerob 3 жыл бұрын
SWR provides the caching layer for you. So if you make a request to /api/user, you can use the useSWR() hook in 100 places across your codebase calling that same endpoint, and they're all looking to the same place in the cache!
@abumubarak_dev
@abumubarak_dev 3 жыл бұрын
@@leerob Amazing even without internet connection?
@TeamEternalEmpire
@TeamEternalEmpire 3 жыл бұрын
@@abumubarak_dev yes
@snakezize
@snakezize 3 жыл бұрын
React-query.
@snakezize
@snakezize 3 жыл бұрын
Redux adds a lot of unnecessary complexity and setup. Even in large projects, most of the time you don't need redux. Also, many times a lot of state don't need to be at the global scope and with redux people tend to put everything as global state. Unless redux middlewares like sagas are needed and are properly used, redux is unnecessary.
@snakezize
@snakezize 3 жыл бұрын
@@shahzadaalihassan_vlogs Yes
@CodingNuggets
@CodingNuggets 3 жыл бұрын
@Jack Saat This is true, but Redux is overkill for many projects.
@krtirtho
@krtirtho 3 жыл бұрын
react-query
@rpgzan2028
@rpgzan2028 3 жыл бұрын
React Context for context and xstate for state! context is the values you need through a component, state is a state!
@suhanbangera884
@suhanbangera884 Жыл бұрын
I was frustrated by redux🥴. I ended up creating my own state management library 🥴🥴
@alejomakevids
@alejomakevids 3 жыл бұрын
I was trying to learn how to luse redux with redux tk, but then the docs mentioned the use of IMMER. It was a totally turn off for me.
@Mobilemaniaplays
@Mobilemaniaplays Жыл бұрын
Zustand
@botyironcastle
@botyironcastle 4 ай бұрын
just use angular it doesnt suck
@ThomazMartinez
@ThomazMartinez 3 жыл бұрын
Zuuuuuuuustanddddddddd
@varandpezeshkian6299
@varandpezeshkian6299 3 жыл бұрын
the answer is, all of them, I usually combine context/swr/hooks. Going forward I can see redux become less popular.
@ehsankhorasani_
@ehsankhorasani_ 3 жыл бұрын
I prefer zustand
@matheusvictor9629
@matheusvictor9629 2 жыл бұрын
just don't use redux and you will probably be okay (or better than with redux)
@vasileturus
@vasileturus 3 жыл бұрын
You should use redux, sorry guys
@lardosian
@lardosian 3 жыл бұрын
I think the central store is a big advantage, I have been trying context and use useReducer which is fine for small projects but doesnt feel right as things start to grow.
@vasileturus
@vasileturus 3 жыл бұрын
@@lardosian same here
@ufufu001
@ufufu001 3 жыл бұрын
but it's so hard
@vasileturus
@vasileturus 3 жыл бұрын
@@ufufu001 I agree
@exactzero
@exactzero 3 жыл бұрын
@@ufufu001 Check out redux-toolkit. Much easier and cleaner code.
@xseman
@xseman 3 жыл бұрын
none.. more bloat more complexity
@xseman
@xseman 3 жыл бұрын
@Jack Saat Throwing other problems at a problem is not the solution
State Managers Are Making Your Code Worse In React
13:33
Web Dev Simplified
Рет қаралды 211 М.
Picking From 20 React State Managers
35:18
Jack Herrington
Рет қаралды 86 М.
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
Learn React Hooks: useCallback - Simply Explained!
17:15
Cosden Solutions
Рет қаралды 111 М.
Why I Moved from React Redux to Zustand and Why You Should Too!
19:24
Zustand - Complete Tutorial
19:27
Cosden Solutions
Рет қаралды 113 М.
Managing React Application State Management - Talk by Kent C. Dodds
30:15
freeCodeCamp Talks
Рет қаралды 61 М.
React Query: It’s Time to Break up with your "Global State”! -Tanner Linsley
29:01
React Conferences by GitNation
Рет қаралды 141 М.
Goodbye, useEffect - David Khourshid
29:59
BeJS
Рет қаралды 505 М.
Vite 6 is important, here's why
19:35
Theo - t3․gg
Рет қаралды 106 М.
This Library Makes State Management So Much Easier
12:07
Web Dev Simplified
Рет қаралды 137 М.
Why I avoid useEffect For API Calls and use React Query instead
17:45
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН