|
|
|
|
|
by eyelidlessness
1074 days ago
|
|
Okay, I’ll volunteer. Hooks solve a real problem in a really unidiomatic way that makes real code hard to understand. They put invisible function boundaries around return values and create state machines inside the body of functions which don’t correspond to the actual function body. I could say the same thing about Solid and its reactivity, and I have. But at least with Solid you know where the magic begins: an opening JSX tag. With hooks, it’s everwhere and you can’t know where magic and non-magic share a space because it’s externalized to linters which have limited capabilities to cross module boundaries. I don’t like any of this magic but I’ll take “it happens predictably at an angle bracket with a well defined next character” any day. |
|
Sure, solid is better in that respect, but react couldn’t have done any other way if it wants to work without a compile-phase.