forge42dev / remix-hook-form

Open source wrapper for react-hook-form aimed at Remix.run
MIT License
354 stars 29 forks source link

Form states #6

Closed CripyIce closed 1 year ago

CripyIce commented 1 year ago

Hi there, A bit new to this library and react-hook-form. How can I use the form states to show a loading and also a message when form is submitted successfully? I saw all of formState available properties, but didn't manage to put it to work. Thanks!!

AlemTuzlak commented 1 year ago

Hello @CripyIce, I am assuming you are using this library inside of Remix. The form submits directly to the server so the best way to keep track of your submission is by using this hook: https://remix.run/docs/en/main/hooks/use-navigation By checking if it is idle or not. Or if you're using a fetcher you can check the docs on how to handle a submission state there too. If you have other questions feel free to ask!

CripyIce commented 1 year ago

Thanks @AlemTuzlak! I managed by following the link you provided me.