|
|
|
|
|
by dartos
629 days ago
|
|
I thought pre-hooks react provided a really nice and simple abstraction over how the web works. FRP is a nice fit for the kind of UI that makes the majority of the web. Hooks ruined the framework imo. Confusing api (useState returning an array for example). Having a class component with hooks for lifecycle behavior made perfect sense. Each component’s state being a field on those classes was easy to understand. Hooks came out of left field and made everything more complex for the worse. |
|
It just returns a tuple. That's not confusing at all and it's a very well established pattern in most modern languages.
If there's anything that can be considered complex and footgun-y in React it's useEffect because most of the time you shouldn't use it at all but it can be abused very easily and it kinda works even if you abuse it (but introduces a huge maintenance burden).