I really like how Zustand solve the state problem without creating more problems to deal with, at least in the simple apps. Btw what font do u use in vscode?
Think react query and form libs need to be mentioned because those are alternatives that help offload what people think of as “global” state and help organize slices of state.
I do not know about all the up to down approach libs… I clouds be wrong, but it always feels like a monolithic application. Too much thing in a single react component. Usually what I’m doing is to use JOTAI every time that I want the state to be shared among componentes and I create a custom hook to manipulate the data. This custom hook introduces all methods needed globally to manipulate data. It allows me to use things like SWR to controle the server state, for example.
For me, I don't think that recoil's atom cannot store function is a problem as we can export the function and give it the required fields. Maybe there's some use case that needs to store functions in a global state? I'm not sure, at least I don't encounter it yet
In recoil you can write selectors that take care of this, like a middleware between atoms and your components. Or am I missing something here, it's all quite new to me
You talk about how jotai is super simple, but I fear your excitement got the better of the demo. Clearly, you're passionate about it, but you went way too fast for someone who is trying to get an idea about how it works. Still a great talk. I'll have to skim over it for now and research myself which is fine but because you went too fast it just makes it feel way more complex.Oh god it gets even faster after that... I had to drop it... you killed my brain. I mean I've had a day of work, I'm tired, it would really help if you'd slow down.
Since Zustand and Jotai are both really light ... why not just use both of them ? So for quick useState-like stores, you use Jotai and for fully managed stores you use Zustand ? what do you guys think about it ?
I think you should just use one thing and be consistent throughout your app. Using two systems to do similar things like that is just adding complexity and unnecessary bloat; even if it is small.
I wish typescript was t the standard in RU-vid tutorials anymore. It's very confusing to see as I'm still trying to understand more complex JavaScript and advanced React stuff. So to through in typescript is a little bit much for me, personally. I feel like it's only really used in very public facing production environments too.
useContext is good for state that doesn't change often like light/dark theme mode. useContext causes all components subscribed to it's values to re-render when a value changes. react-tracked can help improve performance of useContext but there are better solutions for frequently updated global state.
@@jii808i wish I would've come accross this comment 1 month earlier. I don't know why people/ content creators don't tell from start what's best practices. They would rather teach application of usecontext and leave at that. But they hardly tell when it should be used and what are its limitations and drawbacks. Surprisingly enough I found out yesterday what it does after I enabled highlight component on rerender option In react profiler
@@thorw2136 I don’t think most content creators know themselves. I’m using Zustand mostly for global state, react query for server state. Context rarely.
i checked, and i think zustand and easy peasy has similar implementation, for *creating a store* that is, except that with zustand there is no Provider