|
|
|
|
|
by rxhernandez
1188 days ago
|
|
> Are class components really on the down & out? In the popular sense, they've been on the down and out for years now. > It turned in to a bit of a mess until I went for a refactor into classes and everything became much more clear. in my experience, once the logic starts to become complex, you need to develop custom hooks so that a given component stays readable. The hooks paradigm is a lot harder once you get past the basics, but I wouldn't go back for reasons I could articulate if there's any interest. |
|
I hate hooks. The syntax feels nice to type, but the issues outweigh the benefits for me. It’s way too difficult to understand the rendering lifecycle, the state updating, the ordering and I also find the reuse abstraction hard to follow (although I accept that might be a concentration/attention issue on my part). Conversely, it’s also way too easy to break the purity of the hook callbacks, so hooks can use state from contexts you wouldn’t expect (more an issue with custom hooks if you don’t also supply linter tooling to go with them).
Why do you prefer them?