menu

React Hook Form

๐Ÿ“‹ Custom React hooks for form validation without the hassle

Channels
Team

React-Hook-Form watercooler

July 31, 2019 at 1:06am

July 31, 2019 at 2:25am

Good idea @bluebill1049 :)

  • reply
  • like

July 31, 2019 at 10:32pm

Thanks @barry4ui :)

  • reply
  • like

Thanks heaps for the link issue, my eyes were bleeding over that problem..

  • reply
  • like

August 7, 2019 at 12:40am

haha sure. Btw, I don't want to make this public in an issue, but I am looking into moving my web app I use the react-hook-form for into a React-Native app, so I'll see how it works ;)

  • reply
  • like

August 7, 2019 at 10:34am

ha nice. going to be a bit of challenge, cause i have used quite few web API

  • reply
  • like

it would be amazing to make it work tho, but i haven't got time to work on it. (spend most of my time on web atm)

  • reply
  • like

yeah, I know - might need to split out a native module to adapt to this without bloating the main. will keep you posted

like-fill
1
  • reply
  • like

August 11, 2019 at 10:54am

just asking, why is there a need to wrap the formState in an object? is it better if we could just spread it off just like other property? and why errors is not part of a formState?

  • reply
  • like

August 11, 2019 at 11:47pm

good question @jeromedeleon

  • reply
  • like

I guess errors should be part of formState

  • reply
  • like

that was a bad decision when i created the API

  • reply
  • like

What i should have done is group errors inside formState or like you said just flat them all.

  • reply
  • like

ah i do remember why i have decided to group them in formState, it was easier to document them in a group https://react-hook-form.com/api#formState at the time

  • reply
  • like

but yea i regret not having errors in there

  • reply
  • like

Yeah, I came from formik and I thought there was a confusion when you group them but not included errors in formState. Anyway, are you going to change that? just asking :)

  • reply
  • like

August 12, 2019 at 11:12am

hey @jeromedeleon probably not right now. it's going to be a breaking change. For now i will leave errors out there, until the next major release i will fix this issue

  • reply
  • like

thanks for picking this up tho ๐Ÿ™๐Ÿป

  • reply
  • like

plus pick up those other issues as well.

  • reply
  • like

hey @jeromedeleon probably not right now. it's going to be a breaking change. For now i will leave errors out there, until the next major release i will fix this issue

I will wait for that :)

like-fill
1
  • reply
  • like

August 15, 2019 at 2:42pm

hm, how do we do validation of customInputs? I'm stuck with react-select over here, will probably remove it at some point but would be great to have validation on it meanwhile. I'm using https://github.com/react-hook-form/react-hook-form/blob/master/examples/customInput.tsx as reference. however adding a validate function to register() does not seem to do anything. triggerValidation does not do anything either..

Edited
  • reply
  • like