Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

⚛️ Do you know what Automatic Batching means in React (v18)? It means that React groups multiple state updates into a single re-render for better performance. ↓

61,817 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

George Moller profil fotoğrafı
George Moller2 yıl önce

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 50+ video animations just like this one. Check them out ↓

George Moller profil fotoğrafı
George Moller2 yıl önce

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 50+ video animations just like this one. Check them out ↓

Shivam Jha profil fotoğrafı
Shivam Jha2 yıl önce

Here’s a post explaining this in detail (shameless plug)

George Moller profil fotoğrafı
George Moller2 yıl önce

Minor correction: it should read we have 3 todos at the end of the last render.

Pavel Romanov profil fotoğrafı
Pavel Romanov2 yıl önce

Didn't know about this feature. Would love to see more content on rendering like React Fiber and others

George Moller profil fotoğrafı
George Moller2 yıl önce

It was super fun to make this so I might just make more about react rendering process Pavel :)

Jamal Ahmad profil fotoğrafı
Jamal Ahmad2 yıl önce

I didn't not understand because the code looks the same at the end

George Moller profil fotoğrafı
George Moller2 yıl önce

The code is the same. What changes is how react batches updates. Before each setState triggered a new re-render. After React 18, react batches setStates and only does one render at the end.

Osama profil fotoğrafı
Osama2 yıl önce

Count is derived state anyway, needless to use state for it but I understand the topic is something else

George Moller profil fotoğrafı
George Moller2 yıl önce

You are right, that and the fetch inside useEffect were just added for context. Would derive cont from state and also wouldn't fetch in useEffect.

Benzer Videolar