useLayoutEffect Vs useEffect - Which Is Better?

preview_player
Показать описание


🌎 Find Me Here:

#Shorts
Рекомендации по теме
Комментарии
Автор

Best explanation ever, and took less than a minute. That's what I'd call web dev simplified.

EuSouAnonimoCara
Автор

By the way, callback in useLayoutEffect is synchronous(block rendering while executing), and the callback in useEffect is asynchronous(non-blocking)

lyphuc
Автор

You just solved a problem I’ve been trying to solve for the past days. 🤩 This will reduce my code a lot. Thanks!

sarensw
Автор

I love you man. I wish the documentation was that easy. ❤

anasalhariri
Автор

I love these shorts because you learn something in no time 😂😂

abdullahtanveer
Автор

Wow. I always learn something on every single video I watch from this channel. Great work!

daviers
Автор

I discoverer your channel some days ago, It is an awesome channel, congrats so much for your work and for sharing!

rafa_guitar
Автор

Wow! Little earler I learn base React synax and now I can read that code. Amazing!

Thanks for your tips!

andrejstube
Автор

I needed to know this like 8 months ago Kyle!!! Lol

Michael-Martell
Автор

Don't forget manipulating the DOM is usually a bad practice. There are exceptions, but normally you would change your component data that controls the rendered markup

froxx
Автор

So I guess this is React.js related? Your channel covers everything from Vanilla to various libraries so that's kind of important information to have SOMEWHERE (title, description, the video itself).

stevenleonmusic
Автор

please please please make a full website with login and payment system with react, i cannot find it any where and i would like YOU to make a video like this because you are the best javascript youtuber i have found

razorjhon
Автор

As a Dev working with react for a long time I didn't even know this existed lol

lukeet
Автор

Wow perfect timing I was just thinking about this question lmao 👍👍

Imraann
Автор

learned about this for the first time trying to use a third party component api-reference

davidmhanlon
Автор

So it's basically awake method in Unity C#

sadmanyasar
Автор

I always thought useLayoutEffect runs later. Lovely shorts

himbary
Автор

your explanation is simple and understandable, can you add explanation video about samevaluezero algorithm in javascript.

yashwinin
Автор

In short here's how it works:

1. State Updates
2. React Re-renders Component
3. DOM Gets Updated
4. useLayoutEffect Runs
5. Browser Repaints Screen
6. useEffect Runs

LePhenixGD
Автор

i didnt even know that we hae uselayouteffect :D

alirezaseyedzade