Video wird geladen...
Video konnte nicht geladen werden
why does React have "Rules of Hooks?"
107,084 Aufrufe • vor 1 Jahr •via X (Twitter)
11 Kommentare

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.

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

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

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

my new fav youtuber i guess 😁🔥

That's seriously interesting 💯

Conditionally calling useState with no returns?

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

Wait what

I needed this !!

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.
Ähnliche Videos
Sensitive content
WHY DOES LACY HAVE 5 PAIRS OF HANDCUFFS AND A HONEY PACK 😭
Stable Updates
12,140 Aufrufe • vor 1 Jahr


