Live data from Hacker News

Show HN: React Hook Form – Simple Form Validation

react-hook-form.com

61–70 of 75 posts

Re: Show HN: React Hook Form – Simple Form Validation

#61

I’ve been using this for the past few weeks and I’m very happy with it. I really appreciate the minimalism. It’s easy to have schema driven forms and uncontrolled inputs with this library because it doesn’t have many constraints. Also, maybe it’s because of hooks, but it feels like less code than usual is required for forms. I once built a massive “multi page questionnaire with conditional logic” feature, using a sup…

wow thanks, chatmasta, I am really glad to hear this great feedback! I would like to put the credit towards React Hook because it really saves us to write less code and not to worry too much about the lifecycle methods.

Re: Show HN: React Hook Form – Simple Form Validation

#62
Hey author, I’m a long time reader and this is my first post on here! That being said, I absolutely LOVE your library! I’ve been working on a project for a client (a react webapp). I initially built out our signup workflow and delayed completion on that feature until the very end of the app simply because custom validation was a pain (and with tight deadlines, I really didn’t want to write one from scratch). I came across your library about two weeks ago and it fit like a GLOVE! Custom validation was easy, adding in regex expressions was straightforward, and your docs are very clear! Kudos for this project, you’ve made my life much easier. My app happened to also be built entirely with react hooks so this really was a great fit. And the dependency size is much smaller than competitors I was looking at. Thanks for your hard work I definitely appreciate it!

Re: Show HN: React Hook Form – Simple Form Validation

#63
post #62

Hey author, I’m a long time reader and this is my first post on here! That being said, I absolutely LOVE your library! I’ve been working on a project for a client (a react webapp). I initially built out our signup workflow and delayed completion on that feature until the very end of the app simply because custom validation was a pain (and with tight deadlines, I really didn’t want to write one from scratch). I came a…

Thank you very much byahya for your kind words and the lovely message. I am really glad could help you out with building forms. This is also one of the reasons why I am so passionate about building open source projects, be a dev only also me to solve particular within a product or project. it's so good we have an amazing community who are sharing their idea and code around the world. It's my 2 cents to give back the community and help out others and of course doing something meaningful in my life :) I really appreciated your feedback and your encouragement, feel free to ask a question or submit issues in the GitHub. <3

Re: Show HN: React Hook Form – Simple Form Validation

#64
post #38

I strongly recommend to automate form generation based on JSON schema what will enable zero coding for maintenance tasks like e.g. synchronization with model changes. As form code is the most important entry point for security flaws in web applications it is also the most expensive and it is not a good idea having to touch production code for every little backend change. This looks like PHP coding 15 years ago. Do no…

How on Earth does this remotely look like "PHP 15 years ago" to you?

lol

Re: Show HN: React Hook Form – Simple Form Validation

#65

I’m going to hijack to request some help understanding whether hooks are a good thing or.... a mediocre thing I just have to accept. Here are my questions: 1) Is it just me or so hooks really push you to commit to either “state comes from props” or “state is held internally” but you REALLY can’t mix the two? So, if I have say, a searchable select box, I must either A) be stateless, and let some other part of the syst…

This is a good guide for "thinking in hooks": https://wattenberger.com/blog/react-hooks

You can combine whatever inputs you want, whether props or internal state variables. Hooks are basically a way to specific "do X whenever any of Y variables change", regardless of what those vars are.

Re: Show HN: React Hook Form – Simple Form Validation

#66
post #43

Front-end has gone completely off the deep end. I'm looking at the source code and there must be 4 or 5 dozen modules, totally 5.1kb gzipped! And as far as I can tell all it does is copy el.value onto an object. What ever happened to care in our profession? What happened to putting the users first? If you are adding 5kb of overhead to your website for this , it is criminal malpractice.

"It Depends" as always. They are already using React - that probably tells you something about the kind of site they are designing. Likely a very interactive web experience or even a SPA. It'll have image assets > 5kb, and probably 100k's of JS. The user needs to weigh up an extra 5kb vs. the developer utility of this.

Re: Show HN: React Hook Form – Simple Form Validation

#67

Earlier quoted context omitted.

Can you point to a real world example of what you mean? I think I have heard of something similar but it didn’t seem to have caught on in any major web frameworks that I know of (strongly typed json API server which generates runtime validators on frontend and backend). Even then most people want control over the presentation of the form and wouldn’t want to create fields from the schema (e.g. a number type is someti…

A friend of mine build a solution like this: https://laraform.io/ If I have a form anything more complex than a login page, then I usually use some kind of generator based on a schema.

interesting project! thanks for sharing

Re: Show HN: React Hook Form – Simple Form Validation

#68

I strongly recommend to automate form generation based on JSON schema what will enable zero coding for maintenance tasks like e.g. synchronization with model changes. As form code is the most important entry point for security flaws in web applications it is also the most expensive and it is not a good idea having to touch production code for every little backend change. This looks like PHP coding 15 years ago. Do no…

The latest JSON Schema draft introduces some nasty patches that fix the previous draft's limitation. It's even more confusing, it's not designed to generate form even if people have tried (some things can't easily map to form) and the latest spec said so.

Re: Show HN: React Hook Form – Simple Form Validation

#69

Earlier quoted context omitted.

I'm in the process of ripping a system like this out of our main onboarding application. The idea sounded so great: "Just add another object to an array and the form field will magically appear with validation, persistence, etc". The reality is that business requirements turned it into a ton of special case "if" statements. I'm going to avoid that for the next go-round.

yea, I have been working forms for a while, there is hardly a page where a form just couple inputs and a submit button. There are conditional display, design and UX requirements. I can see this working for a one-page simple form.

If all goes according to plan, we plan to use your library in an update to our onboarding process. You've even helped me in your GitHub issues, so you are very appreciated!

Re: Show HN: React Hook Form – Simple Form Validation

#70

Earlier quoted context omitted.

yea, I have been working forms for a while, there is hardly a page where a form just couple inputs and a submit button. There are conditional display, design and UX requirements. I can see this working for a one-page simple form.

If all goes according to plan, we plan to use your library in an update to our onboarding process. You've even helped me in your GitHub issues, so you are very appreciated!

oh sweet! that's great to hear. my pleasure to help.
Post reply on HN