|
|
|
|
|
by dimal
1181 days ago
|
|
Saying hooks are less confusing than classes and understanding the weirdness of `this` is a pretty bad selling point and easily refuted. Hooks are weird. Really weird. They make all your components that use them impure which makes them harder to reason about. But hooks do compose better than classes. With classes, everything is tied to `this` which means that if you decide to reuse some stateful or effectful(?) logic somewhere, you have to disentangle it from `this` first. So on the whole, I think hooks are a win over classes. But they are weird and confusing. |
|