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

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

На главную

why does React have "Rules of Hooks?"

107,084 просмотров • 1 год назад •via X (Twitter)

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

Фото профиля James Landrum
James Landrum1 год назад

I had a component I needed to work different based on an attribute (I know this is bad, hear me out) - when one way I needed 2 hooks and when the other way I needed 3. So what did I do? Put a dummy hook and lined them up so that react had no idea. Same hooks, same order, completely different behavior. I’m not proud but also am very proud of such garbage.

Фото профиля UserInterface
UserInterface2 лет назад

Why Reader-Focused Websites Triumph Over Google's Algorithm Shifts #marketing #seo

Фото профиля mox 🐀
mox 🐀1 год назад

Feels like the user working for the framework and not the other way around

Фото профиля Dinesh Katariya.
Dinesh Katariya.1 год назад

Wow 😮, so useState uses linked lists under the hood, i thought I was getting infinite re render error due to setState being called infinitely.

Фото профиля Tiger Abrodi
Tiger Abrodi1 год назад

my new fav youtuber i guess 😁🔥

Фото профиля Prasenjit
Prasenjit1 год назад

That's seriously interesting 💯

Фото профиля Rustcity Рустcитий
Rustcity Рустcитий1 год назад

Conditionally calling useState with no returns?

Фото профиля Pete Sena
Pete Sena1 год назад

Photo of me battling rules of hooks on most @nextjs projects. Ps thanks @greensock for your newest hook 👏 recently

Фото профиля from
from1 год назад

Wait what

Фото профиля Uvaan Covenden
Uvaan Covenden1 год назад

I needed this !!

Фото профиля Matt Timmermans
Matt Timmermans1 год назад

It's because each time you use a hook in a rerender, it matches the call to the state you created in the last render. The hook calls are matched up sequentially: call 0 to call 0, call 1 to call 1, etc. This is dangerous, so React devs put in some paranoid guardrails.

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