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

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

На главную

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 просмотров • 1 год назад •via X (Twitter)

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

Фото профиля Dean Masley
Dean Masley1 год назад

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#
Gilbert Matos | Nodejs/Nextjs/C#1 год назад

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
Morgan Feeney1 год назад

Great demonstration of the problem 👏 and solution.

Фото профиля Mark Jaquith
Mark Jaquith1 год назад

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

Фото профиля Daniel
Daniel1 год назад

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

Фото профиля crossatko
crossatko1 год назад

Let’s pretend we didn’t see the shadow

Фото профиля John Urbank
John Urbank1 год назад

I’m lazy and always go all

Фото профиля Zakery Kates
Zakery Kates1 год назад

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

Фото профиля Panta
Panta1 год назад

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

Фото профиля simey
simey1 год назад

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
Peter Cruckshank1 год назад

Great video 📸 Wes is a professional jank finder 🔍

Фото профиля unireverse
unireverse1 год назад

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
tom byrer1 год назад

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

Фото профиля kar
kar1 год назад

love it, thank you 😎

Фото профиля Ali Sherief
Ali Sherief1 год назад

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

Фото профиля gńók
gńók1 год назад

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

Фото профиля Harrison
Harrison1 год назад

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

Фото профиля Marco Fugaro
Marco Fugaro1 год назад

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

Фото профиля Udeet Mittal
Udeet Mittal1 год назад

simple and effective!

Фото профиля RR
RR1 год назад

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

Фото профиля MD NAFIUL ISLAM NOMAN
MD NAFIUL ISLAM NOMAN1 год назад

Thanks for sharing

Фото профиля Himanshu Kumar
Himanshu Kumar1 год назад

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

Фото профиля DevKasun 👨‍💻👺
DevKasun 👨‍💻👺1 год назад

Thanks for the tip Wes!

Фото профиля Andile Simelane
Andile Simelane1 год назад

I would start my poultry business

Фото профиля Zachary Indy
Zachary Indy1 год назад

React = 1000% JUNK

Фото профиля undefined
undefined1 год назад

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

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