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

Fix nested zod types in the field chain #40

Merged
merged 1 commit into from
Aug 12, 2023
Merged

Conversation

GRA0007
Copy link
Member

@GRA0007 GRA0007 commented Aug 11, 2023

Fixes an issue with the FieldChain type that happened when an object (or any zod container) schema was used for a controlled field, and any modifiers like ZodNullable or ZodDefault were being stripped from that schema too early, resulting in them being missing from the final types.

I've also added support for more Zod types, like Map and Set. Finally I moved the register function back into useForm.ts so it doesn't have to be exported, which removes it from the library exports as it's an internal method only.

@GRA0007 GRA0007 requested a review from giraugh August 11, 2023 03:06
@GRA0007 GRA0007 self-assigned this Aug 11, 2023
@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2023

🦋 Changeset detected

Latest commit: f403cf8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stevent-team/react-zoom-form Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@giraugh giraugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@GRA0007 GRA0007 merged commit 1b953a2 into main Aug 12, 2023
3 checks passed
@GRA0007 GRA0007 deleted the fix/nested-zod-object-types branch August 12, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants