News for hackers. Stuff that matters.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @06:43PM (#20238136)
Since the majority of the community will probably be using hooks from now on it will be assumed that is the default React methodology which will break books, talks, blog posts, SO answers, etc.
Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @06:52PM (#20238211)
You can mix-and-match. If you want to write an individual component as a class you can, and if you want to later convert it to using hooks there's nothing stopping you.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:03PM (#20238295)
That's not the point.

The point is that most of the React literature available today will become obsolete.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @07:04PM (#20238299)
How? It's still perfectly valid, usable, idiomatic React.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:17PM (#20238401)
If you learned React with hooks the class notation won't make sense, and viceversa.
Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @07:18PM (#20238415)
So they should have renamed the whole framework when they added a single a new feature so people know they need to learn it before reading the examples?
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Thursday June 20, 2019 @07:57PM (#20238666)
It's not a new feature it's a complete new methodology.
Re:Vue RFC: Expose logic-related component options via funct... by root_axis on Thursday June 20, 2019 @08:43PM (#20238890)
The point is that you don't have to use it. If you can't be bothered to learn a simple new feature then just keep doing it the old way; your code will still work. I don't even understand the complaint; are they never supposed to change anything? It's totally optional; even if most of the community goes down that direction you don't have to.

Beyond that, hooks are super simple and the complainers are just making a big deal out of nothing. They are just callback functions that you implement outside of a class instead of overloading arbitrary method identifiers like "componentDidUpdate".

You also don't have to use it.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @08:42PM (#20238881)
That's quite hyperbolic. Functional components have existed in React for a long time, hooks are just adding existing concepts (state and lifecycle operations) to them.
Re:Vue RFC: Expose logic-related component options via funct... by pier25 on Friday June 21, 2019 @10:42AM (#20242880)
We will have to agree to disagree. IMO the compositional paradigm of hooks is radically different than using classes for example.
Re:Vue RFC: Expose logic-related component options via funct... by BigJono on Thursday June 20, 2019 @07:40PM (#20238557)
This is what I don't get about hooks. Remembering Markbages great talk on 'Minimal API Surface Area'? How is having multiple ways of doing the same thing minimal API surface area?

React is losing sight of what made it great when it came out. Do one thing, do it well, and do it the simplest way possible.

Re:Vue RFC: Expose logic-related component options via funct... by thatswrong0 on Thursday June 20, 2019 @08:08PM (#20238728)
That sort of absolutist logic will never allow a framework to progress and become better. Sometimes good ideas come around (IMO like hooks) that are worth increasing the API surface area for.

I for one loathe using class components now and not being able to share logic compositionally via hooks when I work with them. I feel more productive and I feel like my components are smaller and more focused, and I don’t repeat myself as much. It’s been a net win for me, and I think it’s well worth having two supported APIs that do roughly the same thing.. because despite this, React is still a small and focused library API-wise.

Re:Vue RFC: Expose logic-related component options via funct... by ng12 on Thursday June 20, 2019 @08:43PM (#20238889)
They've increase the surface to reduce it over time, if that makes sense. Hooks are much more natural, simplistic way to write stateful components.