Рет қаралды 2,816
In this video we will explore how we can use Jotai's "useHydrateAtoms" hook to hydrate our atoms with the server-side data. This method helps us avoid prop-drilling as well as unnecassary re-renders in our application.
After we finish implementing "useHydrateAtoms", we will focus on two utilities from Jotai: "focusAtom" and "selectAtom" These utilities will help us avoid re-rendering the components that we don't update.
I hope that you like this video and if you do, please don't forget to subscribe my channel and if you have any question please leave it as a comment!
- timestamps -
00:00 - Intro
01:09 - useState version
03:50 - useHydrateAtom
07:55 - Prop Drilling
19:00 - selectAtom
24:40 - focusAtom
29:11 - Further Optimisation
31:33 - Outro
Source Code: github.com/batuhanbilginn/jot...
Learn more: makr.dev
#react #statemanagement #nextjs #jotai