Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

⚛️ 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 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von George Moller
George Mollervor 2 Jahren

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 ↓

Profilbild von George Moller
George Mollervor 2 Jahren

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 ↓

Profilbild von Oleg | Front-End Architecture
Oleg | Front-End Architecturevor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

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!

Profilbild von Shripal Soni
Shripal Sonivor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

Glad you found it useful Shripal!

Profilbild von Vitalii, decaf developer
Vitalii, decaf developervor 2 Jahren

Can you just remove from effect dependencies?

Profilbild von Csaba Kissi
Csaba Kissivor 2 Jahren

Great explanation George.

Profilbild von George Moller
George Mollervor 2 Jahren

Thanks Csaba!

Profilbild von Guilherme de Lucas
Guilherme de Lucasvor 2 Jahren

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."

Ähnliche Videos