Live data from Hacker News

With React 16.8, React Hooks are available in a stable release

reactjs.org

111–120 of 181 posts

Re: With React 16.8, React Hooks are available in a stable release

#111

Hooks seem to be a drastic change in how we're going to write React components in the future. I'm quite satisfied with the current way of writing components which is to me is very explicit (with no magic). With Hooks React is taking a different direction from their original motto of explicit design patterns. From the looks of it, Hooks seems like a counter-intuitive design pattern but traditionally that's how most of…

Glad to read that as the top comment, because when they came out, I expressed strong doubts about this new features, and I mostly received mad comments in return. The alienated react fans stated that I didn't understand what modern code was, what a great idea those were and how from now on, everything will be better. Now hooks are certainly a technically interesting pattern. I can see why it can be desirable by some.…

> Glad to read that as the top comment, because when they came out, I expressed strong doubts about this new features, and I mostly received mad comments in return. The alienated react fans stated that I didn't understand what modern code was, what a great idea those were and how from now on, everything will be better.

Your post boils down to "Seems like it might be nice, but there might be bad sides, too" which seems fair, but the rest of your post is dressed up in a weird gloating dismissiveness and an exaggerated narrative about you, the epic heroic, fighting back the baying React Fans like in Doom's cover art.

I wouldn't celebrate your skepticism just yet, especially not just because you found someone else on HN to commiserate with.

There have been what I think are some convincing arguments for it in the comments and linked urls like https://overreacted.io/react-as-a-ui-runtime/.

Re: With React 16.8, React Hooks are available in a stable release

#112

Hooks seem to be a drastic change in how we're going to write React components in the future. I'm quite satisfied with the current way of writing components which is to me is very explicit (with no magic). With Hooks React is taking a different direction from their original motto of explicit design patterns. From the looks of it, Hooks seems like a counter-intuitive design pattern but traditionally that's how most of…

In case you’re curious, I recently wrote up a deep dive on React from first principles that includes Hooks. https://overreacted.io/react-as-a-ui-runtime/ Personally I don’t see them as being either “magic” or “implicit”. You might find my post helpful for conceptualizing how they fit into the picture. (Warning: it is a longread. But it also explains 90% of React on a single page.)

what a coincidence I just finished reading this article yesterday (and even Tweeted about it https://twitter.com/BilalBudhani/status/1092784595756556294).

TBH, After reading the article I'm definitely putting effort to understand the thought process behind this change. Thank for writing up such a detailed & informative explanation on concepts in React.

Re: With React 16.8, React Hooks are available in a stable release

#113

Earlier quoted context omitted.

Glad to read that as the top comment, because when they came out, I expressed strong doubts about this new features, and I mostly received mad comments in return. The alienated react fans stated that I didn't understand what modern code was, what a great idea those were and how from now on, everything will be better. Now hooks are certainly a technically interesting pattern. I can see why it can be desirable by some.…

> Glad to read that as the top comment, because when they came out, I expressed strong doubts about this new features, and I mostly received mad comments in return. The alienated react fans stated that I didn't understand what modern code was, what a great idea those were and how from now on, everything will be better. Your post boils down to "Seems like it might be nice, but there might be bad sides, too" which seem…

No my answer boils down to:

- hooks are technically interesting, but make it easy for humans to screw up. It's a precise critic.

- the JS community has bad habits that can catalyse this, and above all, may lead them to avoid seing what's wrong

- they get angry when we say it, and dismiss it as nonsense.

Case in point.

Re: With React 16.8, React Hooks are available in a stable release

#115
post #67

Earlier quoted context omitted.

Soo, why couldn't this be implemented as: class ToggleButton extends React.Component { flag = useState(this, true) count = useState(this, 0) other = useEffect(this, () => { ... }) render() { return this.flag.set(!this.flag.current)>{this.flag.current} } } Then it's very clear that we have two separate sections: initialization and rendering. There's no longer a hidden state stored somewhere else, but you know that if…

But that’s not how it works. They don’t run during initialization, they run on every render. That’s their whole point and what makes them dynamic. I tried to explain this here: https://overreacted.io/why-do-hooks-rely-on-call-order/#flaw...

Do you find it concerning that many software engineers with extensive professional React experience have such a difficult time understanding hooks?

Re: With React 16.8, React Hooks are available in a stable release

#116

Earlier quoted context omitted.

While HN wasn’t convinced last time I posted this, here’s a few posts or sections that explain the static call order thing: https://overreacted.io/why-do-hooks-rely-on-call-order/ https://overreacted.io/react-as-a-ui-runtime/#static-use-ord... https://github.com/reactjs/rfcs/pull/68#issuecomment-4393148... (Persistent Call Index section) Hope this helps, happy to answer questions. We’ve been using Hooks for several m…

One thing that looks 'magical' is how does the setWhatever function lets React know that state has changed and has to re-render? Is there any info/writeup on this anywhere?

Pretty much the same way as this.setState in a class does.

React knows which component is rendering at any point in time — so it knows which component useState() call corresponds to.

I think this explanation is quite accessible:

https://medium.com/@ryardley/react-hooks-not-magic-just-arra...

Re: With React 16.8, React Hooks are available in a stable release

#117

Earlier quoted context omitted.

But that’s not how it works. They don’t run during initialization, they run on every render. That’s their whole point and what makes them dynamic. I tried to explain this here: https://overreacted.io/why-do-hooks-rely-on-call-order/#flaw...

Do you find it concerning that many software engineers with extensive professional React experience have such a difficult time understanding hooks?

Personally, I don't find it any more concerning that many software engineers with extensive professional web development experience had such a difficult time understanding React when it came out. (It was universally ridiculed and dismissed for about a year after it came out.)

It's a different mental model. It doesn't "click" immediately for everyone but I've seen it "click" enough times for both beginners and experienced developers that I'm not worried about it.

Re: With React 16.8, React Hooks are available in a stable release

#118

I am stealing this thread as it seems to have a lot of really knowledgable people in here. I understand basic javascript but I am not an expert and I had a discussion with a developer I want to hire for a new app I am doing, who said that there is no open source components (like quill) which easily allow you to have textformating (bulleted lists, bold, text size etc) and that it would have to be done from scratch) wh…

My suggestion to you is to look into web components (e.g. https://github.com/Polymer/lit-element) for theoretically re-usable components.

React is optional for web development.

Re: With React 16.8, React Hooks are available in a stable release

#119
post #28
post #26

Earlier quoted context omitted.

I honestly don't think that there will be another framework that'll overtake react anytime soon. It's not about there being a better framework, just that we finally have something that's "good enough".

True. I used ExtJS and Ember for years and React just operates on another level.

I would say the same for Elm architecture and type system that guarantees no runtime exceptions. There is nothing similar in frontend languages and frameworks.

Re: With React 16.8, React Hooks are available in a stable release

#120
post #16

Earlier quoted context omitted.

A variation on Elm? Why not just Elm?

Well, he said "the next frontier". Probably implies that Elm didn't catch on, and means "what will the next major framework/paradigm/fad will be post-React".

I’m looking seriously at ReasonML. I think it’s more promising than Elm.
Post reply on HN