Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Thanks to `flushSync`, you can finally manage focus in React again 🙌 (but I will always love this.setState)

598,988 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

Ryan Florence profil fotoğrafı
Ryan Florence2 yıl önce

Actually I think it showed up in React 16? I dunno, but pretty sure I didn't see it documented until React 18.

MapleLeaf 🍁 profil fotoğrafı
MapleLeaf 🍁2 yıl önce

this is a great video and flushSync() is a good API, but FWIW, this could potentially be solved by giving the effect more info about what happened

Scott Corgan profil fotoğrafı
Scott Corgan2 yıl önce

For those wondering how he shows the active element in the console automagically:

Code With Antonio profil fotoğrafı
Code With Antonio2 yıl önce

see Ryan now I feel bad about my genius solution 😔 fine I'll refactor it...

Jamie Kyle is on 🦋 profil fotoğrafı
Jamie Kyle is on 🦋2 yıl önce

Based on some of the responses to this, I feel like you need to add a chyron for each section like "This is the wrong way" and "This is the right way"

Ryan Florence profil fotoğrafı
Ryan Florence2 yıl önce

Haha for real. I have to live my life expecting them to watch the whole video, read the whole article, and RTFM, otherwise I will be mentally crippled.

👨‍💻 damir.fun 😎 profil fotoğrafı
👨‍💻 damir.fun 😎2 yıl önce

Great explanation, thanks! Cannot wait to be asked about this in an interview now

Ryan Florence profil fotoğrafı
Ryan Florence2 yıl önce

Oh no 🤦🏼‍♂️

Nick Hudkins profil fotoğrafı
Nick Hudkins2 yıl önce

That useEffect bug! With the mounting! I also deeply appreciate calling that code “non-essential”, thanks for this. It also may have convinced me to use co-pilot.

Ryan Florence profil fotoğrafı
Ryan Florence2 yıl önce

Oh geez, co-pilot is my homie

Benzer Videolar