Boolean property is required

I have a custom Form element, the type of it requires a multipart argument, when it passes, the form will be a FormData form, if is not, it will be a JSON form, and I want to do it this way:

<CustomForm<DataFields> ...arguments>  (JSON FORM)
    ...
</CustomForm>

<CustomForm<DataFields> multipart ...arguments>  (MULTIPART FORM)
    ...
</CustomForm>

but it actually shows an typing error when I do the first one (JSON form), instead, I need to do this:

<CustomForm<DataFields> multipart={false} ...arguments>  (JSON FORM)
    ...
</CustomForm>

This is the error I get:

Type '{ children: Element[]; onSubmit: () => void; }' is not assignable to type 'IntrinsicAttributes & CustomFormProps<FieldValues>'.
  Property 'multipart' is missing in type '{ children: Element[]; onSubmit: () => void; }' but required in type '{ multipart: false | void | null | undefined; onSubmit: (data: FieldValues) => void; }'.ts(2322)
form.ts(12, 2): 'multipart' is declared here.

At first, this is what my Type looked like:

type CustomFormProps<T extends any> = {
    children?: ReactNode | ReactNode[]
    setMethods?: Function
    className?: string
} & ({
    multipart: true
    onSubmit: (data: FormData) => void
} | {
    multipart: false
    onSubmit: (data: T) => void
})

Then I though, “ok, it must be because when I don’t pass any value, the multipart property gets an ‘undefined'” so I changed it to this:

type CustomFormProps<T extends any> = {
    children?: ReactNode | ReactNode[]
    setMethods?: Function
    className?: string
} & ({
    multipart: true
    onSubmit: (data: FormData) => void
} | {
    multipart: false | undefined | null | void
    onSubmit: (data: T) => void
})

But it didn’t work either. What do I need to do to fix this?