State Management with Jotai: splitAtom Utility to Fix Re-render Issue

  Рет қаралды 617

makrdev

makrdev

Күн бұрын

In this video, we explore Jotai, an atomic state management library that helps you manage large states without sacrificing performance. We discuss the "splitAtom" utility, which allows you to split an array of objects to get individual atoms, preventing unnecessary re-renders.
The video starts with an introduction to the problem with using the useState hook, where we have two different components, one built with regular useState and the other with Jotai's splitAtom. Each tile in the table represents a separate component in your app, and let's assume you have a large state object to manage your component tree.
Next, we examine the regular useState version of the component and how it re-renders all tiles when one tile is clicked, causing performance issues. Then, we demonstrate how to fix this problem using Jotai's splitAtom utility by creating an atom for each tile instead of using useState hook.
With Jotai, we can manage each tile's state individually, and when one tile is updated, only that tile will re-render, not the others. This way, we can prevent unnecessary re-renders and improve the performance of our app.
By the end of this video, you'll have a better understanding of Jotai and how it can help you manage your app's state more efficiently.
- timestamps -
00:00 - Intro - What's the problem with useState?
02:02 - useState version of component
03:12 - Creating the same component with "splitAtom"
Source Code: github.com/batuhanbilginn/jot...
Learn more: makr.dev
#react #statemanagement #nextjs #jotai

Пікірлер: 6
@brayanyevenes5954
@brayanyevenes5954 Жыл бұрын
You are really one of the few people who put out jotai content in a more in-depth way to really get the most out of the library, it's always nice to see your jotai videos. greetings from chile
@makrdev
@makrdev Жыл бұрын
Thank you so much. I’ll made full course on Jotai with advanced topics in the future. I think it doesn’t get the credit it deserves.
@enesdemirci7963
@enesdemirci7963 Жыл бұрын
kanka ingilizcen on numara sakin temiz . Bu jotai de ilk Türk kaynaksın galiba başarılar ...
@makrdev
@makrdev Жыл бұрын
Güzel yorumun için teşekkür ederim dostum 🤜
@streamocu2929
@streamocu2929 Жыл бұрын
thank you
@makrdev
@makrdev Жыл бұрын
❤️
Mastering React Context: Do you NEED a state manager?
37:26
Jack Herrington
Рет қаралды 97 М.
Каха и суп
00:39
К-Media
Рет қаралды 3,7 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 40 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 23 МЛН
Do This Instead Of Loading Skeletons
13:30
Ljupche Vasilev
Рет қаралды 531
Things you didn't know about re-rendering in React
4:40
Code Sketched
Рет қаралды 25 М.
Rebuilding Jotai State Manager for React in 20 Minutes!
20:25
Jack Herrington
Рет қаралды 31 М.
Don't Use React Context!! Use This instead
13:34
CoderOne
Рет қаралды 26 М.
The Most Underrated State Management Tool in React
23:35
Cosden Solutions
Рет қаралды 10 М.
Jotai Async
18:47
Sinclair Software
Рет қаралды 1,3 М.
Jotai React - Better Global State Management
10:28
Monsterlessons Academy
Рет қаралды 20 М.
State Management for React: Jotai From Beginners to Masters
16:56
Jack Herrington
Рет қаралды 23 М.
Samsung Galaxy 🔥 #shorts  #trending #youtubeshorts  #shortvideo ujjawal4u
0:10
Ujjawal4u. 120k Views . 4 hours ago
Рет қаралды 3,3 МЛН
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 644 М.
Опять съемные крышки в смартфонах? #cmf
0:50
Мой инст: denkiselef. Как забрать телефон через экран.
0:54