Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

⚛️ Future React tip ↓ ❌ Omitting useEffect dependencies usually leads to hard-to-find bugs. ✅ Having said that, there are use cases when you need to run an effect only when reactive parts of the useEffect changes ↓ Extract non-reactive parts with useEffectEvent()

78,174 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 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 just like this one. Check them out ↓

Oleg | Front-End Architecture profil fotoğrafı
Oleg | Front-End Architecture2 yıl önce

The amazing part about it, there is not single word about it in release notes. When did this land ? 🤔

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

It's not part of a stable React release yet, but you can find more info here I find this to be one missing piece for the useEffect hook, hope they release it soon!

Shripal Soni profil fotoğrafı
Shripal Soni2 yıl önce

I didn't know about `useEffectEvent` hook before. Nice tip, George 👍

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

Glad you found it useful Shripal!

Vitalii, decaf developer profil fotoğrafı
Vitalii, decaf developer2 yıl önce

Can you just remove from effect dependencies?

Csaba Kissi profil fotoğrafı
Csaba Kissi2 yıl önce

Great explanation George.

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

Thanks Csaba!

Guilherme de Lucas profil fotoğrafı
Guilherme de Lucas2 yıl önce

Is useEffectEvent already on React? The react documentation says "This section describes an experimental API that has not yet been released in a stable version of React."

Benzer Videolar