5
Zy--
6y

Why are hooks so awful?

What justifies having everyone using React relearn how to do things when hooks do not bring any new features to React?

Why does getting setInterval to work with hooks require a ~3000 word blog post by a maintainer which constantly assures you this IS a step forward?

Is scrolling up and down a class component really so hard that this clusterfuck is worth it?

>:(

Comments
  • 3
    Hooks are not meant to replace classes, or lets call them screens (the ones that the user will interact with)

    They are made to take away the need to create an entire class of a Component for example for text fields, toolbars, and any other object that is a part of something bigger.

    When you need to dive into lifecycle handling and have a complex scenario to work with in your screen, hooks will fuck things up as they are function components and, and functions have one responsibility.
  • 3
    @gitpush My problem is that the React team has said that in the future, they imagine all components will be written with hooks.

    So, to my mind that implies that they think hooks will be naturally and obviously preferable to classes in all scenarios.

    When typical tutorial-fodder like a timer requires diving into creating custom hooks, using refs, negotiating closures and knowing the rules of hooks (or installing someone else's hook as a package - LOL?!) this statement makes me scratch my head.
  • 4
    @Zy-- this statement makes me avoid react XD
    Seriously, thats too much :\
  • 3
    @gitpush No kidding - I have considered that it might just be quicker to learn Vue instead of hooks.
  • 1
    @Zy-- it sure is, I tried vue and like at least how code looks like
  • 1
    i thought i was going to have to learn JS sooner or later...

    and along comes Razor :D
Add Comment