Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

This is CSS performance problem I see all too often. The React website has some jank due due to their use of transition. Here is how to find what causes it and how and fix it

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

26 Yorum

Dean Masley profil fotoğrafı
Dean Masley1 yıl önce

I cant believe I'm just seeing this. Had no idea it was so unoptimized. Feel so embarrassed for reaching for transition-all so regularly 🤦‍♂️ Never again! Thanks for sharing!

Gilbert Matos | Nodejs/Nextjs/C# profil fotoğrafı
Gilbert Matos | Nodejs/Nextjs/C#1 yıl önce

It goes to show you, being able to solve all Leet code and pass interviews won't stop you from still doing this kinda stuff at work 🤣🤣🤣

Morgan Feeney profil fotoğrafı
Morgan Feeney1 yıl önce

Great demonstration of the problem 👏 and solution.

Mark Jaquith profil fotoğrafı
Mark Jaquith1 yıl önce

Great find. But why can’t the browser do this optimization under the hood? 🤔

Daniel profil fotoğrafı
Daniel1 yıl önce

No transition on the shadow anymore though🥴 it justs blinks on/off

crossatko profil fotoğrafı
crossatko1 yıl önce

Let’s pretend we didn’t see the shadow

John Urbank profil fotoğrafı
John Urbank1 yıl önce

I’m lazy and always go all

Zakery Kates profil fotoğrafı
Zakery Kates1 yıl önce

Wow. I’ve been using “all” for years not even considering the performance impact. In hindsight, it’s so obvious. Thank you.

Panta profil fotoğrafı
Panta1 yıl önce

Very cool! TIL browser doesn't know how to track only properties that change

simey profil fotoğrafı
simey1 yıl önce

Hmm... But actually the box-shadow is no longer transitioning, which looks very awkward. I am not 💯 but I don't think the "all" is the crux of the issue here and the solve was more of a side effect similar to removing the transition altogether.

Peter Cruckshank profil fotoğrafı
Peter Cruckshank1 yıl önce

Great video 📸 Wes is a professional jank finder 🔍

unireverse profil fotoğrafı
unireverse1 yıl önce

Yep always best to avoid transition all. It's definitely the box shadow that's killing it. If you wanted to keep the shadow animating, it should be in a pseudo element and transition opacity on hover

tom byrer profil fotoğrafı
tom byrer1 yıl önce

3x4 aspect ratio video?!? What wizardry is this!?! Thanks for the tip.

kar profil fotoğrafı
kar1 yıl önce

love it, thank you 😎

Ali Sherief profil fotoğrafı
Ali Sherief1 yıl önce

These kind of problems need to be squashed as they are found.

gńók profil fotoğrafı
gńók1 yıl önce

For me it's rare to "transition" anything other than the "transform" property

Harrison profil fotoğrafı
Harrison1 yıl önce

Probably a cursor tab for a transition property which it loves to do

Marco Fugaro profil fotoğrafı
Marco Fugaro1 yıl önce

bröther, the box-shadow transition was causing the lag, not what you said in the video

Udeet Mittal profil fotoğrafı
Udeet Mittal1 yıl önce

simple and effective!

RR profil fotoğrafı
RR1 yıl önce

wesbos love your tutorials, but is using no-transitions really a viable solution for React

MD NAFIUL ISLAM NOMAN profil fotoğrafı
MD NAFIUL ISLAM NOMAN1 yıl önce

Thanks for sharing

Himanshu Kumar profil fotoğrafı
Himanshu Kumar1 yıl önce

Over-reliance on transitions can indeed hinder performance, but exploring alternative animation techniques like Web Animations API might offer smoother results.

DevKasun 👨‍💻👺 profil fotoğrafı
DevKasun 👨‍💻👺1 yıl önce

Thanks for the tip Wes!

Andile Simelane profil fotoğrafı
Andile Simelane1 yıl önce

I would start my poultry business

Zachary Indy profil fotoğrafı
Zachary Indy1 yıl önce

React = 1000% JUNK

undefined profil fotoğrafı
undefined1 yıl önce

I didn't expect that drop in performance; thanks for the tip. How can I show that info square in the top left corner?

Benzer Videolar