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

Add ctx object to Zod resolver #724

Open
ericlifs opened this issue Nov 1, 2024 · 0 comments
Open

Add ctx object to Zod resolver #724

ericlifs opened this issue Nov 1, 2024 · 0 comments

Comments

@ericlifs
Copy link

ericlifs commented Nov 1, 2024

Zod's resolver does not support passing useForm's context as to superRefine zod method.

Proposed solution

After reading useForm's documentation I have noticed you can have an optional context object on your form so it then gets passed to the resolver as the second argument.

Unfortunately after debugging this for a while I have noticed that the context gets omitted and it is never sent to Zod's resolver:
image

The context works perfectly on the useForm resolver:
image

But the context is never set on the zod resolver:
image

Additional context

image image

I hope I expressed myself well, otherwise I can explain the problem further.

Thanks!

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

No branches or pull requests

1 participant