Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 1 Jahr •via X (Twitter)

26 Kommentare

Profilbild von Dean Masley
Dean Masleyvor 1 Jahr

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!

Profilbild von Gilbert Matos | Nodejs/Nextjs/C#
Gilbert Matos | Nodejs/Nextjs/C#vor 1 Jahr

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 🤣🤣🤣

Profilbild von Morgan Feeney
Morgan Feeneyvor 1 Jahr

Great demonstration of the problem 👏 and solution.

Profilbild von Mark Jaquith
Mark Jaquithvor 1 Jahr

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

Profilbild von Daniel
Danielvor 1 Jahr

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

Profilbild von crossatko
crossatkovor 1 Jahr

Let’s pretend we didn’t see the shadow

Profilbild von John Urbank
John Urbankvor 1 Jahr

I’m lazy and always go all

Profilbild von Zakery Kates
Zakery Katesvor 1 Jahr

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

Profilbild von Panta
Pantavor 1 Jahr

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

Profilbild von simey
simeyvor 1 Jahr

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.

Profilbild von Peter Cruckshank
Peter Cruckshankvor 1 Jahr

Great video 📸 Wes is a professional jank finder 🔍

Profilbild von unireverse
unireversevor 1 Jahr

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

Profilbild von tom byrer
tom byrervor 1 Jahr

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

Profilbild von kar
karvor 1 Jahr

love it, thank you 😎

Profilbild von Ali Sherief
Ali Sheriefvor 1 Jahr

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

Profilbild von gńók
gńókvor 1 Jahr

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

Profilbild von Harrison
Harrisonvor 1 Jahr

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

Profilbild von Marco Fugaro
Marco Fugarovor 1 Jahr

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

Profilbild von Udeet Mittal
Udeet Mittalvor 1 Jahr

simple and effective!

Profilbild von RR
RRvor 1 Jahr

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

Profilbild von MD NAFIUL ISLAM NOMAN
MD NAFIUL ISLAM NOMANvor 1 Jahr

Thanks for sharing

Profilbild von Himanshu Kumar
Himanshu Kumarvor 1 Jahr

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

Profilbild von DevKasun 👨‍💻👺
DevKasun 👨‍💻👺vor 1 Jahr

Thanks for the tip Wes!

Profilbild von Andile Simelane
Andile Simelanevor 1 Jahr

I would start my poultry business

Profilbild von Zachary Indy
Zachary Indyvor 1 Jahr

React = 1000% JUNK

Profilbild von undefined
undefinedvor 1 Jahr

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

Ähnliche Videos