Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

❌ Avoid using objects as dependencies in React.useEffect() ✅ Instead use the primitive keys

43,042 görüntüleme • 1 yıl önce •via X (Twitter)

8 Yorum

George Moller profil fotoğrafı
George Moller1 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 70+ video tutorials just like this one. Check them out ↓

SecurityPal profil fotoğrafı
SecurityPal1 yıl önce

“When something breaks, be transparent, own it, fix it. And it's really about how you respond to it.” @WilHarm3 (@craft_ventures) emphasizes the importance of transparency and responsiveness when things go wrong. Watch the episode here:

skylerdj👻 profil fotoğrafı
skylerdj👻1 yıl önce

or be toxic and wrap the object with `JSON.stringify()`

Gustavo AL. profil fotoğrafı
Gustavo AL.1 yıl önce

Good advice, but in this case you might not need an useEffect. Like this article of official documentation said, a useEffect is to synchronize external state (API, storage, DOM) with internal state of React.

Mohammad, the Dev one. profil fotoğrafı
Mohammad, the Dev one.1 yıl önce

Here,understanding the concept of passed by value and passed by reference shines. When we put an passed by reference item into the dependency array, it makes the useEffect to re-run on reach re-render. Good point 👍

Alejandro profil fotoğrafı
Alejandro1 yıl önce

if you use const {userId} = params everything should be the same no?

Ethan_AI Marketer for 𝕏 profil fotoğrafı
Ethan_AI Marketer for 𝕏1 yıl önce

Have you tried using primitive keys in your useEffect dependencies? It can really help avoid unnecessary re-renders. I’ve seen it make a big difference in performance.

nome profil fotoğrafı
nome1 yıl önce

i want a react job i am working in react since 2 years i have strong grip on react ,redux , tailwindcss,material ui ,ajax ,axios ,jsx , props , hooks ,state management , ui responsive design

Benzer Videolar