Загрузка видео...

Не удалось загрузить видео

На главную

⚛️ 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 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля George Moller
George Moller2 лет назад

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
George Moller2 лет назад

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
Oleg | Front-End Architecture2 лет назад

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

Фото профиля George Moller
George Moller2 лет назад

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
Shripal Soni2 лет назад

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

Фото профиля George Moller
George Moller2 лет назад

Glad you found it useful Shripal!

Фото профиля Vitalii, decaf developer
Vitalii, decaf developer2 лет назад

Can you just remove from effect dependencies?

Фото профиля Csaba Kissi
Csaba Kissi2 лет назад

Great explanation George.

Фото профиля George Moller
George Moller2 лет назад

Thanks Csaba!

Фото профиля Guilherme de Lucas
Guilherme de Lucas2 лет назад

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

Похожие видео