Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer form type from zod schema #417

Closed
wants to merge 1 commit into from

Conversation

maddijoyce
Copy link

Hi all,

I'm not sure if there's a specific reason this wasn't happening, but the react-hook-forms resolver type can overwrite the generic for TFieldValues. When you do this it allows typescript to infer the types in the form (for example in the submit handler), to match what the zod schema is producing.

I've included the change below 👍

Thanks,
Maddi

@stale
Copy link

stale bot commented Oct 19, 2022

Thank you for your contributions! This Pull Request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Best, RHF Team ❤️

@stale stale bot added the stale label Oct 19, 2022
@stale
Copy link

stale bot commented Oct 29, 2022

Thank you for your contributions! This Pull Request is being closed because it has not had any recent activity. Feel free to re-open the issue and begin work again! Best, RHF Team ❤️

@stale stale bot closed this Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant