Skip to content
Discussion options

You must be logged in to vote

Hello @sant527,

You don't need to use both at the same time. You can use any one for registering inputs.

If you wish to use ref then you need to use this like: ref={register} and if you wish to validate your fields on onChange too then simply put this as mode like this:

const methods = useForm({ defaultValues: user, mode: 'onChange', resolver: yupResolver(validationSchema(translation)), })

const { handleSubmit, reset, register, formState: { errors }, } = methods

otherwise, you can use onChange method to get and validate values by creating your own function or use the pre-defined one.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bluebill1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants