Union type issues using `withForm`
I have a
Contact domain that has a create/patch endpointI'm trying to create a shared component
ContactFormFields that can be used in both the create and patch contexts. I can check in runtime if we are doing a create or patch and render conditionallyThese are my types
The shared component
My edit form - https://pastes.io/react-contactviewform-with-patch-form-type-error-comment
And there is a similar create form(leaving out cause this is getting too long for Discord)
I have 2 problems
Problem 1
In my edit and create forms I get a type error passing
form to ContactFormFields (this is for <ContactFormFields type="patch" form={form} />)https://pastes.io/type-mismatches-for-formasyncvalidateorfn-and-formvalidateasyncfn
Problem 2
In the
ContactFormFields