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

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

На главную

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

598,988 просмотров • 2 лет назад •via X (Twitter)

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

Фото профиля Ryan Florence
Ryan Florence2 лет назад

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

Фото профиля MapleLeaf 🍁
MapleLeaf 🍁2 лет назад

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
Scott Corgan2 лет назад

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

Фото профиля Code With Antonio
Code With Antonio2 лет назад

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

Фото профиля Jamie Kyle is on 🦋
Jamie Kyle is on 🦋2 лет назад

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
Ryan Florence2 лет назад

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 😎
👨‍💻 damir.fun 😎2 лет назад

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

Фото профиля Ryan Florence
Ryan Florence2 лет назад

Oh no 🤦🏼‍♂️

Фото профиля Nick Hudkins
Nick Hudkins2 лет назад

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
Ryan Florence2 лет назад

Oh geez, co-pilot is my homie

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