4 ms·
Agreed. In fact, it smells like the author doesn't know what he's talking about; in my experience "That will break for the following incredibly subtle reasons:
by neolefty 6y ago
Agreed.
In fact, it smells like the author doesn't know what he's talking about; in my experience "That will break for the following incredibly subtle reasons:" is usually about React fundamentals such as being deliberate with state mutations.
Custom hooks are some of the most useful and fun code to write, in my experience.
- madeofpalk 6y agoI was going to say - the main reason why I like Hooks is because it's a lot simpler to reason with compared to classes, and it makes it easier to avoid whole classes (heh) of bugs. If anything, React is becoming less of a black box, with a 'simpler' API. It's just that in the process to moving to or learning the new API, people are understanding they didn't actually understand React before. They're now being made to confront that.
- hn_throwaway_99 6y ago> He is the founder of Formik and co-host of The Undefined Podcast. You can disagree with him fine, but I'm quite sure the founder of Formula knows what he's talking about when it comes to React.
- j-krieger 6y agoFormik started as a class-based library and most likely still uses some under the hood. Maybe he's just not a fan of the hook API and prefers the other way?
- dota_fanatic 6y agoFwiw, we have a stable admin client that uses Formik. One month, I went to update dependencies. Since the admin client was stable, I only updated its deps for minor versions. Four weeks or so later I get a bug report for that client. Nothing obvious or non-obvious jumped out at me in the component of concern and its blame. After git bisecting, it turns out the minor version bump to Formik had a breaking change. I've only touched that package a few times since but it never fails to make me wish the original lead hadn't used Formik. I dunno, forms in react have never given me tears, but contrary to Formik's slogan it has been painful, even aside from this versioning fiasco, so I'm not sure this endorsement is as strong as you think it may be.
- hn_throwaway_99 6y agoI'm not endorsing Formik in any way, but I don't think making an accidental breaking change in a minor version is exactly a cardinal sin. What I'm saying is silly is to say the author is somehow "uninformed" when it comes to React like he's some sort of newbie, as opposed to the guy who wrote the library that a sizable percentage of React apps use for their form components.
- nkohari 6y ago> author doesn't know what he's talking about The author is Jared Palmer. He's a well-known engineer who has worked with React for years, and the author of a very popular OSS React library (Formik).
- wulfricin 6y agoI think he is a bias against hooks since his library(Formik) doesn't work well with Hooks with react-hook-form coming up to take its throne
- j-krieger 6y agoI think you hit the hammer on the head with this one.
- KuhlMensch 6y agoOh, that seems conveivable. I used Formik long before hooks, then later, after hooks. I remember hesitating a few times because some of the exceedingly neat pattern/syntaxes were impacted negatively by hooks. I still "happy" with both, but my team is all quite senior and I feel for jnr teams trying to grapple with React AND hooks at the same time.
- krnsk0 6y agoCan confirm that Formik's hooks API is really not very good. Any change to any form component results in the entire form rerendering when hooks are used to connect to Formik context. Lost months of time in last gig to the choice to use Formik.