DEV Community

Samir shrestha
Samir shrestha

Posted on

How to update form using react-hook-form

Top comments (1)

Collapse
 
vt2730 profile image
vikash tiwary • Edited

You can add default values in useForm function where you can pass each field value of the respective form.

 const {
        handleSubmit,
        control,
        formState: { errors },
        reset
    } = useForm(defaultValues: {
//all textField values
//for example email: emailValue
});
Enter fullscreen mode Exit fullscreen mode