Typescript type issues with validate after updating to v7.52.0
Hi, the following snippet started showing typescript type errors after I updated the react-hook-form version to v7.52.0 while it was working fine for v7.51.5. It has something to do with the following PR and I was wondering if someone can help me out to figure out whether the problem is in my code or something with the library. I had to change the
rules?: RegisterOptions;
to rules?: RegisterOptions<T, Path<T>>;
after the version update.
Link to the snippet: https://stackblitz.com/edit/vitejs-vite-lqawwb?file=src%2FForm.tsx
Link to the PR: https://github.com/react-hook-form/react-hook-form/pull/11969
PS: validate
works fine if there is only one property and type of string
in FormInputs
typeGitHub
fix: enforce type safety for
deps
property in RegisterOptions
b...Overview
This PR restricts the deps property within RegisterOptions to accept only field names or an array of field names instead of string | string[].
This change improves type safety and prevents...
2 Replies
like-gold•13mo ago
Maybe you wanted this for your
validate
function?
Also, this is the Discord for TanStack Form and not 'react-hook-form' 🙂correct-apricotOP•13mo ago
My bad 😦 I somehow mixed them both.