I'm attempting to compose a form with optional components, e.g. in a given form there may or may not be a component that collects customer information. I'd like to add zod validation for each of these components, and then I'll add some conditional logic to render the 'blocks' as needed. I'm attempting to add a second of these components (rental period) but I'm running into some types trouble with the
onChange
onChange
in the validator(fixed by not using
z.union()
z.union()
as well as passing the
form
form
object as props to the form components.
Sorry if the image is confusing, I can add more context if needed. Disclaimer I'm pretty new to React and Tanstack, so I may be conflating terms. Thanks for any help.