Giter VIP home page Giter VIP logo

Comments (8)

AlemTuzlak avatar AlemTuzlak commented on May 31, 2024 2

Fixed with 3.1!

from remix-hook-form.

jam-fran avatar jam-fran commented on May 31, 2024 1

@AlemTuzlak Seems to be related to a feature released ("disable prop for useForm") in v 7.48.0 of react-hook-form: https://github.com/react-hook-form/react-hook-form/releases/tag/v7.48.0

Downgrading to v 7.47.0 fixed the error for me.

from remix-hook-form.

AlemTuzlak avatar AlemTuzlak commented on May 31, 2024

@jam-fran what version are you on?

from remix-hook-form.

jam-fran avatar jam-fran commented on May 31, 2024

@AlemTuzlak Here are my packages:

"@hookform/resolvers": "^3.3.2",
"@remix-run/node": "2.2.0",
"@remix-run/react": "2.2.0",
"@remix-run/serve": "2.2.0",
"react-hook-form": "^7.48.2",
"remix-hook-form": "^3.0.4",
"zod": "^3.22.4"

from remix-hook-form.

AlemTuzlak avatar AlemTuzlak commented on May 31, 2024

Interesting, in theory this shouldn't happen because I extend their type to type the hook, they might have changed it to something, I will investigate this, thank you!

from remix-hook-form.

jam-fran avatar jam-fran commented on May 31, 2024

from remix-hook-form.

willian avatar willian commented on May 31, 2024

I am having the same issue. And when I downgraded to 7.47.0 as suggested by @jam-fran the error changed. I am using shadcn's Form component, which relies on react-hook-form. This is the error after downgrading to 7.47.0:

 │      Type '{ children: Element; handleSubmit: (e?: BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>; reset: (values?: { full_name: string; ... 14 more ...; accept_communication?: boolean | undefined; } | { ...; } | undefined) => void; ... 12 more ...; setFocus: UseFormSetFocus<...>; }' is not assignable to type 'UseFormReturn<{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; }, any, undefined>'. typescript (2322) [64, 8]
 │        Types of property 'reset' are incompatible. 
 │          Type '(values?: { full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; ... 9 more ...; accept_communication?: boolean | undefined; } | { ...; } | undefined) => void' is not assignable to type 'UseFormReset<{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; }>'. 
 │            Types of parameters 'values' and 'values' are incompatible. 
 │              Type '{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; } | { ...; } | ResetAction<...> | undefined' is not assignable to type '{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; } | { ...; } | undefined'. 
 │                Type 'ResetAction<{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; }>' is not assignable to type '{ full_name: string; email: string; cpf: string; birthday: string; mobile_number: string; marital_status: "single" | "married" | "divorced" | "widowed" | "stable-union" | "other"; sex: "female" | "male"; ... 8 more ...; accept_communication?: boolean | undefined; } | { ...; } | undefined'. 

from remix-hook-form.

piotrkulpinski avatar piotrkulpinski commented on May 31, 2024

I can confirm the issue with the latest package versions:

CleanShot 2023-11-10 at 21 47 41

from remix-hook-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.