The proper way to do GLOBAL STATE in React - Jotai, Boiletplate-free Redux

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • Global State Variables in React without Redux or boilerplate. Jotai takes an atomic approach to global React state management inspired by Recoil.
    PocketBase Crash Course Playlist:
    • PocketBase Crash Course
    Jotai Docs:
    jotai.org/
    Hostinger Promo Code: RAVENJS
    hostinger.com/...
    (use code RAVENJS for 10% off all products/plans)

Komentáře • 18

  • @billionaireempire3852
    @billionaireempire3852 Před 3 měsíci +1

    Thank you brother. Exactly what I needed

  • @hussainmustafa9552
    @hussainmustafa9552 Před 7 měsíci +2

    A very helpful and concise video 👍. Keep up the good work.

  • @wahikedeewane2682
    @wahikedeewane2682 Před rokem +5

    Preety good stuff
    Keep posting ❤❤

  • @douglasmatosdev
    @douglasmatosdev Před 9 měsíci +2

    Here in Brazil. Waiting for more content

  • @ThanhNguyen-ho7yo
    @ThanhNguyen-ho7yo Před 4 měsíci +1

    very clear!

  • @parmetra
    @parmetra Před 5 měsíci +1

    Thanks for the review! Everything is very well explained. But I still have one question: what is the difference between Jotai and Zustand, and also in which case should one or the other be used?

  • @Raghunadh9
    @Raghunadh9 Před 5 měsíci +1

    Thank you sir

  • @sunflwer
    @sunflwer Před rokem +4

    post the video broda

  • @TheRolldone
    @TheRolldone Před 4 měsíci

    i read article about 7 top react state management. and jotai is easy to learn.

  • @laurentvideo1703
    @laurentvideo1703 Před rokem +2

    really good please post!

  • @sbinalla4205
    @sbinalla4205 Před 11 měsíci +2

    Thank you

  • @sunflwer
    @sunflwer Před rokem +2

    love your vids

  • @skillz121212
    @skillz121212 Před rokem +3

    Hi! Just as a tip when doing todos.map() you can pass in .map(todo, index) and it will create an auto-incremented index for you that you can use as your key :D (If you already knew this then this may just be for some other random viewer who doesn't yet)

    • @alwazkazi1916
      @alwazkazi1916 Před 11 měsíci +4

      Using index as key is not a good practice. If the list is dynamic key should be a unique id. for static using index is fine.

  • @sunflwer
    @sunflwer Před rokem +1

    heyyy post more of the pocketbase too

  • @english51
    @english51 Před 7 měsíci

    awesome video, but need 2k or 4k to see things clear hehe.

  • @user-vy5yh8zx9c
    @user-vy5yh8zx9c Před 10 měsíci +2

    🎯 Key Takeaways for quick navigation:
    00:28 🚀 React developers often face boilerplate issues with global state management.
    00:41 🔄 Jotai is a tool that simplifies global state management in React without complex Redux functionality or prop drilling.
    02:30 🌐 Create a global variable in Jotai using `atom` to manage state across components easily.
    04:18 🧩 Use Jotai's `useAtom` function similar to React's `useState` for intuitive state management.
    07:36 💾 Jotai supports persistence with `atomWithStorage`, allowing state to persist across page reloads using local storage.
    09:51 🚫 Optimize re-renders by using `useSetAtom` in components that only write to the global state, preventing unnecessary renders.
    Made with HARPA AI

  • @alwaysdjango
    @alwaysdjango Před 7 měsíci +1

    Thanks bro