TanStackT
TanStack7mo ago
7 replies
dangerous-fuchsia

Conditional validation schema

Hello dear community,

I have a problem while validation my form schema (schema.png). I have create and update dialog in the same component (dialog.png). I want to make validation based on dialog mode props (create | update). It makes successful api call (adds or updates the record). However, when i check if form parse is successful or not and it gives me this error(error.png).


I have started this project using create-tsrouter-app configs (tsrouter-config.png).

My question is how to pass dynamic zod validator schema to validators.

Thank you in advance
dialog.png
schema.png
error.png
tsrouter-config.png
Was this page helpful?