Zustand - Complete Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

ความคิดเห็น • 263

  • @cosdensolutions
    @cosdensolutions  5 หลายเดือนก่อน +3

    Hope you enjoyed the video! I also have a really cool and unique course that will teach you way more than this video. You'll learn how to build an actual complex project with React. It's called "Project React" and you can find it at cosden.solutions/project-react. Also, I have a free weekly newsletter called "Import React" with tutorials, news, and cool stuff about React! You can sign up at cosden.solutions/newsletter?s=ytc

  • @zebcode
    @zebcode 10 หลายเดือนก่อน +30

    What i love the most about this video is that you do one thing at a time and explain it. So many people do 10 things at once leaving viewers confused and frustrated. Its slightly slower than I required but then you maintain a good cadance. You don't spend time over explaining things.

  • @VladyslavDihtiarenko
    @VladyslavDihtiarenko 11 หลายเดือนก่อน +19

    19 minutes, and I can already use Zustand now. Thank you so much! Very straightforward explanation!

  • @yashpatidar.8506
    @yashpatidar.8506 ปีที่แล้ว +12

    I've watched many videos about Zustand, but only this one has clarified all my doubts. It's the best resource on the topic. Thank you for creating such an awesome and enlightening video! 👏🎉

  • @vladislaviy
    @vladislaviy ปีที่แล้ว +10

    Man you explanaitions of Redux and Zustand are the Top on youtube in terms of how fast and clear you provide it.. thank you!!!

  • @brightonmischief
    @brightonmischief หลายเดือนก่อน

    I may have commented this before, but I think you put out among the best tutorials on TH-cam. Concise, clear; you don't rush through and you don't swamp the viewer with too much at a time. Brilliant work, and thanks for this one - I'm going to checkout Zustand now!

  • @alkadoHs
    @alkadoHs ปีที่แล้ว +9

    Sir, now i should register you to my book as my favorite react teacher. You explain things very clear while keeping the best practices, awesome 😎

  • @aryansuvarna4923
    @aryansuvarna4923 ปีที่แล้ว +3

    literally started learning Zustandd yesterday. THIS VIDEO IS A GOD SEND!

  • @julienheng3880
    @julienheng3880 ปีที่แล้ว +6

    This is what I had anticipated for. Great tutorial as always. Thank you very much!

  • @terryliu3635
    @terryliu3635 7 วันที่ผ่านมา

    This is awesome!! Statement management is so easy in REACT.js using Zustand!

  • @desmond-hawkins
    @desmond-hawkins 13 วันที่ผ่านมา

    Thank you! Great intro to this library. I'm relatively new at React and was struggling to find a clean way to have code outside of the React components mutate state that the components use as part of their rendering. I like how simple zustand is and the attention they gave to separating unrelated values to minimize re-renders.

  • @TannerBarcelos
    @TannerBarcelos ปีที่แล้ว +2

    Zustand is amazing. So light, simple and powerful.

  • @Ksahdia
    @Ksahdia ปีที่แล้ว +2

    When I saw the video title, I thought we had to learn React in German now and wondered if that was the new trend or something. Never heard of Zustand before, thanks for the explanation!

    • @cosdensolutions
      @cosdensolutions  ปีที่แล้ว

      Hahahahaha this killed me 😂

    • @Ksahdia
      @Ksahdia ปีที่แล้ว

      @@cosdensolutions :D

  • @techwithlead
    @techwithlead 4 หลายเดือนก่อน +1

    You were absolutely right, there is everything I need to learn about Zustand, thanks a lot for great tutorial, and best practices advice. Appreciate it.

  • @bharathkumar.k2983
    @bharathkumar.k2983 2 หลายเดือนก่อน +1

    This is an amazing tutorial about zustand. Thank you 🎉

  • @theAsyncGuy
    @theAsyncGuy 4 หลายเดือนก่อน

    No extra talk. To the point and very useful.

  • @Lykkos-321
    @Lykkos-321 หลายเดือนก่อน

    super helpful and understandable without redundancy, your work is always a solution! thanks a lot!

  • @BhagabatiPrasad-fq7xz
    @BhagabatiPrasad-fq7xz หลายเดือนก่อน

    This is the only tutorial I was looking for.

  • @freeshorts4423
    @freeshorts4423 ปีที่แล้ว +1

    you are really amazing sir. best react tutorial ever. lots of love from NEPAL

  • @charlesorafu490
    @charlesorafu490 8 วันที่ผ่านมา

    Straight to the point , thank you.

  • @vipulmaheshwari3568
    @vipulmaheshwari3568 4 หลายเดือนก่อน

    Thanks for the tutorial, I got immense clarity in using zustand.

  • @YisneySoto
    @YisneySoto 4 หลายเดือนก่อน

    Wow, I'm amazed. I loved Redux toolkit, but Zustand is smooth. Thank you for the concise, yet useful explanation.

  • @MicahBala
    @MicahBala 2 หลายเดือนก่อน

    And i was thinking zustand would be complex to implement. Thanks for this educative and easy to follow tutorial. My first tutorial on zustand and its quite clear.

  • @camilo5821
    @camilo5821 ปีที่แล้ว +1

    thanks man!, i really enjoy your videos and shorts.

  • @rakeshkumarparida98
    @rakeshkumarparida98 2 หลายเดือนก่อน

    New subscriber.I love the way you explain every line of code. ❤

  • @nickwithaz
    @nickwithaz 10 หลายเดือนก่อน

    Great video - really clear explanation of the key concepts and how to apply them - thanks!

  • @ToumaRenshi
    @ToumaRenshi 10 หลายเดือนก่อน

    great tutorial, i just started to learn about zustand from yesterday and today i am getting more to understand now. thank you! :)

  • @Oceancoastwaves
    @Oceancoastwaves 5 หลายเดือนก่อน

    Fantastic Stuff! When I just watched this I didn't get much out of it. When I paused the video for a while and coded along with you ,learned it better !Thanks again as he said " this will be your last place to learn Zustand and additional bonus you can go teach somebody ".

  • @EpistemicFomo
    @EpistemicFomo 2 หลายเดือนก่อน

    Perfect explanation! Thank you!

  • @rameezh88
    @rameezh88 ปีที่แล้ว

    Great tutorial. Concise, clear, and quick. Just stumbled upon your video when I was thinking about learning exactly this. Thank you!

  • @Deepakkumar431
    @Deepakkumar431 ปีที่แล้ว +1

    Accurate, to the point. Thanks a lot for sharing.

  • @letaciogalvao9908
    @letaciogalvao9908 10 หลายเดือนก่อน

    Completely awsome, just learned and already implemented in my job! Thanks a lot!

  • @uncore_
    @uncore_ ปีที่แล้ว +1

    Great video.I just want to make something more clear tough, the first practice you mention in the video does also go for redux and the reason why this works is because (old) { } === (new) { } would evaluate as false thus will be treated as state update,but say count is 1 then (old) 1 === (new) 1 would evaluate as true so no updates required

  • @dimitmoto1716
    @dimitmoto1716 3 หลายเดือนก่อน

    Simple, clear and complete ( except a small detail, the devtools for zustand which can becvery usefull if the app is big).
    Thanks a lot!

  • @jaylee9923
    @jaylee9923 4 หลายเดือนก่อน

    Well explained. Flawlessly. Thank you.

  • @OmarAmeen-sb8bt
    @OmarAmeen-sb8bt 11 หลายเดือนก่อน

    you are awesome learned a lot from this session it is definitely a premium content

  • @peterng.
    @peterng. ปีที่แล้ว

    That's awesome!!
    Very concise, clear, and well-explained!
    Keep up the great work, man!

  • @Emeritus-Adabs
    @Emeritus-Adabs 2 หลายเดือนก่อน

    You made zustand easy for me. Thank you

  • @ebenezerifezulike5770
    @ebenezerifezulike5770 หลายเดือนก่อน

    This was easy to understand and straight to the point. Thank you @cosden. I just subscribed 😊

  • @YosephTeki
    @YosephTeki 6 หลายเดือนก่อน

    thanks mate, simple and straightforward explanation

  • @0ninetyseven97
    @0ninetyseven97 ปีที่แล้ว +1

    this gut deserves a million subs

  • @xanteI
    @xanteI ปีที่แล้ว +62

    About the second best practice. Zustand documentation does not recommend creating multiple stores, they recommend creating slices grouped by functionality, and then spread the slices into the main store. I see this inaccuracy in almost all videos and articles on Zustand

    • @cosdensolutions
      @cosdensolutions  ปีที่แล้ว +19

      Aha, you're correct. I had my terminology mixed up

    • @AllanSerna-j5y
      @AllanSerna-j5y ปีที่แล้ว

      hey, could you link this?

    • @rodjenihm
      @rodjenihm 11 หลายเดือนก่อน

      @@AllanSerna-j5y Google "Slices pattern Zustand"

    • @xanteI
      @xanteI 11 หลายเดือนก่อน

      ​@@den9943, yea, it's flux inspired architecture

    • @venicebeachsurfer
      @venicebeachsurfer 10 หลายเดือนก่อน

      This is not true. It is recommended because it is the most popular pattern, BUT there is no benefit to do this other than sticking the whole state under the devTools. Why would you want to include the whole state on a page that only cares about a small slice of it? Performance wise, you'd want seperate stores, I think.

  • @larrymcfarlane6202
    @larrymcfarlane6202 11 หลายเดือนก่อน

    Concise and to the point. Thanks!

  • @johnkumar958
    @johnkumar958 3 หลายเดือนก่อน

    Thank you very much for your teaching. Very helpful to me.

  • @tomasburian6550
    @tomasburian6550 ปีที่แล้ว

    This vid made me sub to you. Lots of good info on this channel.
    Keep it up!

  • @WinchesterD
    @WinchesterD 4 หลายเดือนก่อน

    Thank you for the explanation.

  • @Lisa-r5h5p
    @Lisa-r5h5p 5 หลายเดือนก่อน

    LISA you are the best: song, rap, dance, and aura.

  • @giovanio.3581
    @giovanio.3581 11 หลายเดือนก่อน

    Thanks for the tutorial, It was very easy to understand

  • @evanh.3744
    @evanh.3744 10 หลายเดือนก่อน

    clear and so helpful! it just what i need.thank you

  • @minusmarigold98
    @minusmarigold98 10 หลายเดือนก่อน

    man , you are really best!

  • @someone-on-earth
    @someone-on-earth 8 หลายเดือนก่อน +1

    Very easy to understand Zustand from this video, I've watched like 3-4 tutorials and was still confused as to what is really happening

  • @shehab910
    @shehab910 20 วันที่ผ่านมา

    This guy knows how to teach

  • @swado_2000
    @swado_2000 4 หลายเดือนก่อน

    Good tutorial. Love from 🇮🇳 India.

  • @g-ytub
    @g-ytub ปีที่แล้ว

    One more excellent learning. Thank you so much.

  • @EricTchindje
    @EricTchindje 24 วันที่ผ่านมา

    so amazing course! thanks you big

  • @samislam2746
    @samislam2746 2 หลายเดือนก่อน

    Thanks for your time

  • @nfaical3
    @nfaical3 ปีที่แล้ว +1

    Thanks 👍, nice explanation

  • @rohitghadage3220
    @rohitghadage3220 ปีที่แล้ว

    You are one of the best TH-camr✨

  • @_ayush_oswal
    @_ayush_oswal 10 หลายเดือนก่อน

    Really concise and easy to follow!!

  • @harag9
    @harag9 ปีที่แล้ว +3

    Great tutorial. I watched your Redux video a couple of weeks ago and now this... Since I'm still learning, which one would you recommend ? Would be nice to have a comparison video of pros & cons of them both.

    • @mleite1
      @mleite1 ปีที่แล้ว

      Redux is like a dinosaur..

    • @cosdensolutions
      @cosdensolutions  ปีที่แล้ว +2

      Zustand is simpler and less intimidating. There's less boilerplate code. Redux has been around for longer and is more stable. Both are great tbh and it really depends on more specific use cases in your project that put you towards one or the other!

  • @rdx86
    @rdx86 7 หลายเดือนก่อน

    Fantastic video, very easy to follow and understand. I'd love to see a video on Jotai as well. We've been using it a lot at work and have loved it so far. Only problem is that we can't access the Atom states outside of React components, unlike Zustand.

  • @r34ct4
    @r34ct4 11 หลายเดือนก่อน

    Absolutely brilliant tutorial, It's rare that I understand something so organically and easily, props to you brah

  • @chrishanthacosta4093
    @chrishanthacosta4093 10 หลายเดือนก่อน

    best zustand video..thanks

  • @Ameer_Ameen
    @Ameer_Ameen 8 หลายเดือนก่อน

    oh man idk how to thank you, you just saved me from spending money just to learn zustand .

  • @omaracelys3217
    @omaracelys3217 ปีที่แล้ว

    Thank you for the video !
    One recommandation,
    go through the documentation while coding,
    it helps to understand how to get used to the doc,
    because that can more maintanable et useful in my exprience

  • @AllanSerna-j5y
    @AllanSerna-j5y ปีที่แล้ว +1

    what about something like
    const { count, increment } = useStore();
    would that still be inefficient?

    • @sep1ol
      @sep1ol ปีที่แล้ว

      i have the same question
      did you figure this out?

  • @rogeert
    @rogeert ปีที่แล้ว +4

    I love Zustand.
    Can you make a video about signals?

  • @zerdnelemo
    @zerdnelemo 9 หลายเดือนก่อน

    Great video and great tool. I will give it a try.

  • @patriciogarcia5442
    @patriciogarcia5442 3 หลายเดือนก่อน

    Great video Cosden

  • @AMN_2080
    @AMN_2080 5 หลายเดือนก่อน

    perfect, thank you!

  • @bingers_tv
    @bingers_tv 9 หลายเดือนก่อน

    Excellent tutorial, thanks

  • @statuschannel8572
    @statuschannel8572 ปีที่แล้ว +13

    either disable the copilot or use it 😵‍💫😵‍💫😵‍💫

    • @labhamjain3915
      @labhamjain3915 ปีที่แล้ว +2

      Blud only uses it for personal use, for TH-cam he prefers to type it for viewers to get more connected and it's hectic to disable and enable it for every recording

    • @statuschannel8572
      @statuschannel8572 ปีที่แล้ว +1

      @@labhamjain3915 dude you're telling disable the plugin is hard?
      click on extension
      click on settings icon
      disable(workspace)
      thats it, now you dont have to enable it, it will be disables only for the workspace. and copilot suggestions can distract the viewers so much!

    • @wiktorchojnacki9746
      @wiktorchojnacki9746 3 หลายเดือนก่อน

      @@labhamjain3915 It's not hectic. It's two clicks away.

    • @akeeb3715
      @akeeb3715 2 หลายเดือนก่อน +2

      You are his translator?

    • @TragicGFuel
      @TragicGFuel 20 วันที่ผ่านมา

      @@labhamjain3915 pressing a key combination is hectic?

  • @GHSB7462
    @GHSB7462 2 หลายเดือนก่อน

    Very good. Thank you so much.

  • @Victor-wh9bs
    @Victor-wh9bs 2 หลายเดือนก่อน

    Thanks, Really helpful...

  • @koleen3799
    @koleen3799 7 หลายเดือนก่อน

    Thanks a lot, mate! 🎉

  • @user-xu9tb7oe2z
    @user-xu9tb7oe2z 10 หลายเดือนก่อน

    brilliant education work! thanks!

  • @felix_nope
    @felix_nope 9 หลายเดือนก่อน

    Really nice video, but it made me flinch every time you said “Zustand.” :D

  • @jeetdesaimusic
    @jeetdesaimusic 7 หลายเดือนก่อน

    Amazing Explanation sir!

  • @sajibdas6708
    @sajibdas6708 5 หลายเดือนก่อน

    Thank You So Much😍

  • @SilvestreVivo
    @SilvestreVivo 2 หลายเดือนก่อน

    Something like this we have been using for Svelte for years.

  • @reydantegarcia8776
    @reydantegarcia8776 6 หลายเดือนก่อน

    Thank you, great tuts. By the way, what extension that provides a code suggestion?

  • @piotrzajas9014
    @piotrzajas9014 4 หลายเดือนก่อน

    Well, a nice video - i understand zustand now, it's almost just like redux tookit. You could mention persist and other things tho ;). Kudos.

  • @Mrkostas7777ify
    @Mrkostas7777ify ปีที่แล้ว +1

    Can you also prepare a video for Jotai? It would be very useful since it gains popularity

  • @flwi
    @flwi 9 หลายเดือนก่อน

    This looks interesting. Thanks for showing what zustand can do! I'm not a big fan of accessing & manipulation the state from "everywhere" though, since it has spaghetti-code-potential imo.

  • @arghyadas4138
    @arghyadas4138 11 หลายเดือนก่อน

    Great content
    Subscribed 🙌

  • @collinsk8754
    @collinsk8754 5 หลายเดือนก่อน

    Excellent tutorial!

  • @hanspen5978
    @hanspen5978 ปีที่แล้ว

    on point, I want to make a cart with it tomorrow

  • @sajadzshoki
    @sajadzshoki 4 หลายเดือนก่อน

    great thank you so much

  • @InarusLynx
    @InarusLynx 2 หลายเดือนก่อน

    Watched both redux and zustand. Zustand seems perfect, for what I need. I just need a couple of data points shared across my app and I don't need all the redux bells and whistles for 2 or 3 things.

  • @lutzruhmann7162
    @lutzruhmann7162 ปีที่แล้ว

    This was very helpfull, Thanks!

  • @saeidghorbani-s6b
    @saeidghorbani-s6b 5 หลายเดือนก่อน

    thank you very berief and useful

  • @Lagtcham
    @Lagtcham 6 หลายเดือนก่อน

    Is it possible to have several stores and view both in the devtools?

  • @KylanHurt
    @KylanHurt 11 หลายเดือนก่อน

    Would be cool if you showed how to install the Zukeeper extension as well.

  • @bravesirrobin9576
    @bravesirrobin9576 3 หลายเดือนก่อน

    Pro tip: in the react dev tools settings you can stop it logging twice when in strict mode.

  • @bryandelacruz9066
    @bryandelacruz9066 8 หลายเดือนก่อน

    Do you have a tutorial of this without typescript?

  • @fernandosoaresdev
    @fernandosoaresdev ปีที่แล้ว

    This is a great video, Derick! I have a doubt, if I may: StrictMode runs every hook twice, right? Why should we use StrictMode, and why/when no to use it? Thanks man, happy holidays!

    • @cosdensolutions
      @cosdensolutions  ปีที่แล้ว

      Strict mode is there to prevent you from making mistakes in hooks and not cleaning up your dependencies. Ideally, it shouldn't affect you as you develop if you use it so I would keep it and see if anything breaks. If it does, then you might have a bug!

    • @chinmayghule8272
      @chinmayghule8272 ปีที่แล้ว

      @@cosdensolutions Strict mode only re-renders in development (to catch bugs related to state or effects) and works normally in production where you use the build. The build runs normally.

  • @omarmoustafa2652
    @omarmoustafa2652 6 หลายเดือนก่อน

    This is really awesome

  • @themindstorm9947
    @themindstorm9947 5 หลายเดือนก่อน

    How would you go about computed state?

  • @patrickmichael4113
    @patrickmichael4113 ปีที่แล้ว

    Very insightful. now i got a hang of it. please sir how do you get those code suggestions in your ide?

  • @fabianopereira1011
    @fabianopereira1011 11 หลายเดือนก่อน

    Obrigado, me ajudou muito.