This Makes State Management so Much Easier

preview_player
Показать описание
React context doesn't really cut it anymore. Does it work? Yes! Are there better, cleaner ways in 2023? Hell yeah! Let's take a look at Zustand, a state management library that has been working very well for me.

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

I knew this video was about zustand just from the title lol

thesunabsolute
Автор

Hope you make more vids about Zustand and showcase more complex real world use cases! This library deserves more exposure but their docs are a mess tbh. They’re also considering removing the “create” api in v5 according to a discussion in their GitHub repository

remongrabu
Автор

Although it is okay to use destructuring when you are retrieving data from the store, you should be wary for when you want your component to re-render. If you destructure you are getting retrieving all the store, meaning if something changed, the component will rerender.

If you want a better alternative, use selectors.

moh
Автор

Zustand + React query === Right way to do State management ❤

ayushjain
Автор

Your explanations are really easy to understand!

officialabdulrehman
Автор

zustand is a godsend lib. it's so elegant and tiny. great interface too. i discovered it earlier this year and it's really enjoyable

jawyor-kt
Автор

Hi, great video! Could you make a proper video specifically on zustand, best practices, managing auth state, scalable folder structure, hydrating the state etc. It would be really great as there aren't many tutorials on this.

rog
Автор

Great vid as usual, a next one with a real use case of Zustand could be awsome. A pleasure to have new Josh content every week. ❤

quentinfrancois
Автор

I think for most use cases jotai is better than zustand for the simplicity. It just feels like global useState while zustand is good if u have a lot of actions in a store and you want it access the value outside of react

thecarpenter_son
Автор

Wow, your videos are always so helpful! I have a new video request - could you make a video on how to use React-hook-form with TinyMCE (Rich Text Editor) on Submit, along with the other input fields? It would be amazing to see you tackle this topic and help us all level up our skills. Best of luck 🎉!

honestslave
Автор

jotai is awesome too, no provider needed also and they are using interesting approach called atom

agus-wesly
Автор

One of the greatest things about zustand is that It can manage state outside react, so If you want for example to store data via a function that is not a inside a component, and then consume it inside another function totally different, you can totally do it, without react yelling at you for trying to use reactive state outside components.

itssammy
Автор

I hope you make more videos about zustand.
You're awesome at this! I'm a fan ❤️

jettisonjj
Автор

React context was never meant to be a statement manager. It's simply a means of passing context down to children. For example, say you are implementing the renderCell function in a MUI GridColDef --- you can simply useContext to teleport data or pass context down from a without having to worry how to pass the props through a MUI jungle of relationships

Euquila
Автор

Just waiting for the Ausnahmezustand. Thanks for sharing, will give it a try.

daskasspatzle
Автор

your content just blow my mind, thanks. U r awesome!

kiddasneve
Автор

Quick but Best Explanation! I like zustand for it's simplicity

freeguy
Автор

I love jotai just as much as zustand. It’s from the same devs too.

filipjnc
Автор

Man I love your videos. Thank you so much for this.

captainlennysub
Автор

This came out just as I was starting to learn Zustand ❤

ndrs_dev