Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
Zy--266y@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. -
i thought i was going to have to learn JS sooner or later...
and along comes Razor :D
Related Rants
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?
>:(
rant
react
js
hooks