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!
@alvechy3 жыл бұрын
Jumping straight to XState makes one David somewhere in the world smiling
@benmitchinson98313 жыл бұрын
Sent this video to a dozen devs. Great great explanation that I will be referencing for a long time.
@aaaliii4u Жыл бұрын
now that is called awesome! thanks for the great tutorial and a taste of history.
@pieter-venter3 жыл бұрын
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"
@codersagora98373 жыл бұрын
Hey this video is really useful for our community, thanks!
@leerob3 жыл бұрын
Thank you! Glad you found it useful.
@geralt363 жыл бұрын
Using zustand and immer with typescript. Never enjoyed doing state management so much before.
@mitejmadan86723 жыл бұрын
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
@leerob3 жыл бұрын
I really appreciate this comment. Glad I could help!
@MightyKingKala2 жыл бұрын
Great video!
@vs5993180263 жыл бұрын
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!
@ogbillity3 жыл бұрын
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.
@cheeriozkitty3 жыл бұрын
This is the best video I've seen on this topic. Thank you so much for all of the great info here.
@RYeah1003 жыл бұрын
lol I said "it depends" in the same time haha, great video Lee thanks!
@ashishshinde70702 жыл бұрын
Excellent👍
@frankybegue94923 жыл бұрын
fantastic video. also appreciate the excellent bookmarking 👍
@roobannadarajah79893 жыл бұрын
Who can dislike this. Cheers buddy
@Daniel-ve8yr3 жыл бұрын
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_anil3 жыл бұрын
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.
@domsbuhendwa9243 жыл бұрын
Always great content Thank you for all
@yilmazbingol48382 жыл бұрын
great explanation.
@RickRyan263 жыл бұрын
Great vid!
@kristiankramas59443 жыл бұрын
Wow. This was great.
@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.
@minhquanma3 жыл бұрын
thumbs up for Schiit Stack behind
@okidokiyowyow3563 жыл бұрын
Can I ask whats your react stack? Like what library do you use/like?
@mikkaruru3 жыл бұрын
Thanks Lee! What state management solution can be used for keeping global state of websocket data coming from IOT sensors to dashboard?
@CodingNuggets3 жыл бұрын
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!
@dacks223 жыл бұрын
Your thoughts on zustand? Great vid Lee
@leerob3 жыл бұрын
Thank you! The Zustand authors seem to be recommending Valtio now: twitter.com/dai_shi/status/1358568517100920832
@rakeshpaul56913 жыл бұрын
@@leerob didn’t know about Valtio. I was using zustand + immer for one of my projects. I also found recoiljs very similar to zustand
@ricardocoutinho61833 жыл бұрын
What do you think about recoilJs?
@leerob3 жыл бұрын
4:45 😁No strong opinion other than it works well for certain use cases.
@ГенаПетров-н5ы3 жыл бұрын
What library best for figma like app?
@erickgeneric3 жыл бұрын
Wow. I’m going to have to try swr 😳
@moniruzzamansaikat3 жыл бұрын
thanks for such a video
@jdratlif3 жыл бұрын
I think only components that have useContext and their children rerender, not every component under the context provider.
@onurbamaro2 жыл бұрын
Client state: Hookstate Server state: React Query I've reduced a ton of boilerplate-y code with those Have fun
@mazenfayez58242 жыл бұрын
hello, did you try zustland? would like to here your thoughts, i think it is the simplist one so far.
@renegadeace17352 жыл бұрын
What's so bad about prop drilling? Verbose yes, but clear and easy to understand, also yes!
@sleepysud2 жыл бұрын
Makes it painful to maintain / re-write code.
@Ace_Qnemes Жыл бұрын
Go make something bigger than todo list and you`ll find out
@unmy4003 жыл бұрын
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 🤔
@leerob3 жыл бұрын
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_dev3 жыл бұрын
@@leerob Amazing even without internet connection?
@TeamEternalEmpire3 жыл бұрын
@@abumubarak_dev yes
@snakezize3 жыл бұрын
React-query.
@snakezize3 жыл бұрын
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.
@snakezize3 жыл бұрын
@@shahzadaalihassan_vlogs Yes
@CodingNuggets3 жыл бұрын
@Jack Saat This is true, but Redux is overkill for many projects.
@krtirtho3 жыл бұрын
react-query
@rpgzan20283 жыл бұрын
React Context for context and xstate for state! context is the values you need through a component, state is a state!
@suhanbangera884 Жыл бұрын
I was frustrated by redux🥴. I ended up creating my own state management library 🥴🥴
@alejomakevids3 жыл бұрын
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 Жыл бұрын
Zustand
@botyironcastle4 ай бұрын
just use angular it doesnt suck
@ThomazMartinez3 жыл бұрын
Zuuuuuuuustanddddddddd
@varandpezeshkian62993 жыл бұрын
the answer is, all of them, I usually combine context/swr/hooks. Going forward I can see redux become less popular.
@ehsankhorasani_3 жыл бұрын
I prefer zustand
@matheusvictor96292 жыл бұрын
just don't use redux and you will probably be okay (or better than with redux)
@vasileturus3 жыл бұрын
You should use redux, sorry guys
@lardosian3 жыл бұрын
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.
@vasileturus3 жыл бұрын
@@lardosian same here
@ufufu0013 жыл бұрын
but it's so hard
@vasileturus3 жыл бұрын
@@ufufu001 I agree
@exactzero3 жыл бұрын
@@ufufu001 Check out redux-toolkit. Much easier and cleaner code.
@xseman3 жыл бұрын
none.. more bloat more complexity
@xseman3 жыл бұрын
@Jack Saat Throwing other problems at a problem is not the solution