react-hook-form / devtools

📋 DevTools to help debug forms.
https://react-hook-form.com/dev-tools
MIT License
646 stars 47 forks source link

TypeError: reactHookForm.useFormState is not a function #81

Closed ItayGershman closed 3 years ago

ItayGershman commented 3 years ago

Hey, after installing @hookform/devtools I encountered into this error: "TypeError: reactHookForm.useFormState is not a function"

This is the error on the website: 9 | }; 10 | 11 | const Header = ({ setVisible, control }: Props) => {

12 | const { isValid } = useFormState({ 13 | control, 14 | });

below is my code:

` import { DevTool } from "@hookform/devtools"; return ( <> <form onSubmit={handleSubmit(onSubmit)} className="h-100 d-flex flex-column"

<div className={"d-flex flex-wrap flex-row"}> {inputs.map((input) => { return ( <div style={{ marginRight: 35 }}> <CustomInput register={register} control={control} error={errors[input.name]} watch={watch} formState={formState} defaultValues={input.defaultValues} setValue={setValue} {...input} />

); })}


</> ); `

Thanks :)

bluebill1049 commented 3 years ago

Which version are you using? I mean both react hook form and dev tool, latest version is a made for V7 hook form.

ItayGershman commented 3 years ago

Hey Bill, I worked on the v6, and now I upgraded to v7 and it's working fine, thank you!

yashwant-dangi commented 2 years ago

@bluebill1049 can we use dev-tool with v6, I can not upgrade to v7. For v6, I am getting the above error.

bluebill1049 commented 2 years ago

@bluebill1049 can we use dev-tool with v6, I can not upgrade to v7. For v6, I am getting the above error.

I believe u can use with the old version.