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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send transformed values as submitted values with useField #4692

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mehcode
Copy link

@mehcode mehcode commented Mar 8, 2024

馃攷 Overview

This PR allows transforms to be sent through as the submitted value when the
transform is used in useField and not as a high-level object schema.

馃 Code snippets/examples (if applicable)

See the added test to zod.spec.ts

      const testRules = toTypedSchema(z.string().transform(value => `modified: ${value}`));
      const { value } = useField('test', testRules);

This functionally works but definitely needs some help with the internal types. Not sure how to make them work in the greater scheme without a lot more effort and could use some guidance. Thank you!

Signed-off-by: Ryan Leckey <leckey.ryan@gmail.com>
@mehcode
Copy link
Author

mehcode commented Mar 19, 2024

@logaretm Is there anything I can help with to get this merged and released?

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

1 participant