menu

React Hook Form

馃搵 Custom React hooks for form validation without the hassle

Channels
Team
Posts
Members
Info

Is it possible to pass props down to all children?

For example passing a 'isSkeleton' prop down to each of my inputs to put them into a skeleton/loading state.

thumbsup
0
message-simple
1

Return a promise in handleSubmit

I'm using the option "editable" of material-table, and I want to submit the form when the OK button is pressed, so I have something like this: The problem is that onRowUpdate needs to return a promise, if it's resolved the edit row closes, if it's rejected the edit row remains鈥

thumbsup
0
message-simple
19

How to clear errors in onChange inside Controller?

Hi , I have a text field where user has to enter the value in combination of alphabets and number for that i added a input mask using react-input-mask . So that i wrapped the input field with Controller. OnSumbit the required errors will pop up. After as soon as the user starts鈥

thumbsup
0
message-simple
11
1dLocked# Help

How to know if the form was submitted successfully without any errors?

Trying to change button label if the form was submitted successfully (like 'Submit Another'). Is there any way to find this from formState? or do i have to do this from parent container?

thumbsup
0
message-simple
0

watch is not memoized

Component re-render trigger redefinition of watch variable. It may not be ideal in certain case when some useEffect depends on watch - Maybe I miss something. https://codesandbox.io/s/react-hook-form-basic-dnkc2?file=/src/index.js

thumbsup
0
message-simple
22

How to show common field error validation ?

Eg: I am having four Form Fiels [ Name , Age , DOB ,Gender]. Instead of showing , this field is required ,error message , below that field. I need to show a common error message all fields are required.

thumbsup
0
message-simple
16

How to persist form data with react-modal

I use RHF with react-modal. If a user closes modal without submitting the form, I want to persist form data until a browser reloaded and then if the user opens modal again, they can see previous data user inputted. How should I do that? 鈥

thumbsup
0
message-simple
25

How to read a 1200 lines useForm hook function?

I love this package so that I want to know the implementation details. But when I checkout out the source code, I see the big fat 1200 lines useForm. OMG, is it reasonable?

thumbsup
1
message-simple
4

React-Hook-Form with redux

Hi, I'm trying to get React-Hook-Form working with Redux without success. Got any example? Thanks!

thumbsup
0
message-simple
9

useFieldArray & remove & custom register

Hey! I have a field array question. In the docs, there is a note that says: "It doesn't work with custom register at useEffect." 鈥

thumbsup
0
message-simple
5