Get resolver from useForm return, and schema from resolver #6812
Unanswered
appelsinvandi
asked this question in
Ideas
Replies: 2 comments 4 replies
-
i belive this is related feature: #6472 |
Beta Was this translation helpful? Give feedback.
0 replies
-
@appelsinvandi have you found any workaround for this limitation? I need to access resolvers within my field, but didn't want to create a custom context just for that. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As far as I can tell, there's currently no way to retrieve the resolver from a
useForm
return, and likewise no way to retrieve a schema from aresolver
return.I use
zod
for schema validation, and would love to more easily be able to use zod's introspection methods to make inputs that already useuseFormContext
to determine certain states, be even smarter.Such a component could potentially look like this for zod:
As I believe you can't edit a resolver's schema, and have to pass an entirely new resolver to change it, it should also force a re-render to any component using to it, ensuring that components will still be updated if it changes.
This can of course already be done, by just creating a separate context for the schema yourself. But I thought I would put the idea out there, as I believe it would be convenient to have it all in one place.
I couldn't find any similar discussion or issue, searching for "get resolver" and "retrieve resolver".
Beta Was this translation helpful? Give feedback.
All reactions