Earlier quoted context omitted.
> It's basically the magic vs explicit discussion all over again. Like usually in this discussion, the magic approach is really appealing until it doesn't work, and then the pro-explicit people will go all "told you so" on you. Well... Have any "pro-explicit people" gone all "told you so" about all the magic that's going on with setState? I don't think so. I don't think it's a binary magic vs explicit choice. I usual…
What's wrong with setstate? I have used it without problem.
With React 16.8, React Hooks are available in a stable release
101–110 of 181 posts
Re: With React 16.8, React Hooks are available in a stable release
#102Earlier quoted context omitted.
Hooks offers nothing new over HoC and FaC the same way React offered nothing new over jQuery and EmberJS.
That is being unfair to React. React changed the way developers reason about UI/DOM from imperative to declarative, the holy grail here is that a declarative API allows you to move up your state and have a "single source of truth" and so makes it easy to reason about your application's state at the cost of having more plumbing, for example consider incriminating the value of an input with jQuery (imperative) vs React…
Re: With React 16.8, React Hooks are available in a stable release
#103I 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…
Re: With React 16.8, React Hooks are available in a stable release
#104Re: With React 16.8, React Hooks are available in a stable release
#105I've read a lot about hooks, the reasoning all makes sense but I'm still not fully getting it at an intuitive level. Like I get that it means you can write functional versions of class based components, an example of a complex class component that has been converted to a function with hooks would be good. The counter example really leaves a lot to the imagination. The examples in https://usehooks.com/ aren't convinci…
But the benefit is tighter encapsulation of functionalities. No longer do we have to spread a feature's logic across multiple lifecycle methods that may share that space with logic from other features.
Re: With React 16.8, React Hooks are available in a stable release
#106Earlier quoted context omitted.
> It's basically the magic vs explicit discussion all over again. Like usually in this discussion, the magic approach is really appealing until it doesn't work, and then the pro-explicit people will go all "told you so" on you. Well... Have any "pro-explicit people" gone all "told you so" about all the magic that's going on with setState? I don't think so. I don't think it's a binary magic vs explicit choice. I usual…
What's wrong with setstate? I have used it without problem.
(And of course, there's the magic of the returned object not being set as the new state, but rather being merged into the previous one.)
Re: With React 16.8, React Hooks are available in a stable release
#107Are hooks being accepted as a good design by the community? It seems to me that the lack of a parameter explicitly indicating the component and the reliance on hook ordering to match them across calls of the component function make them a bad design, but I might very well wrong and would be happy to be convinced otherwise.
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…
Re: With React 16.8, React Hooks are available in a stable release
#108Hooks 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…
Re: With React 16.8, React Hooks are available in a stable release
#109Hooks 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.)
Re: With React 16.8, React Hooks are available in a stable release
#110Earlier 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?