Comment by AlexErrant
Comment by AlexErrant 10 hours ago
React DX is hot garbage. Words cannot express how much I LOATHE hook rules. Coming from a Solid JS background, where reactive primitives are just Javascript functions... I groan every single time I run into (yet another) hook rule.
I have to conditionally render empty fragments because React can't handle conditional hooks. It's the stupidest thing ever. "Oh hey let me allocate memory for this hook that will almost certainly never be used except under edge conditions! Sure, React can do conditional components, but conditional hooks are just too much for us!"
> I groan every single time I run into (yet another) hook rule.
There are only two rules:
1. Only call Hooks at the top level
2. Only call Hooks from React functions
Per https://react.dev/reference/rules/rules-of-hooks
Not sure I understand the conditional beef, perhaps you can give example? I would assume if you want `if condition, useEffect(...)` you could simply replace with `useEffect(() => if condition...)`, no?