Is there a way to extend the generic types defined in the type T to a function without duplicating code? Can we reuse generics between types and functions?
type T<FormType extends 'edit' | 'create' = 'create', RecordType extends Record = Record> = {
type: FormType,
record: RecordType
}
const func = <FormType extends 'edit' | 'create' = 'create', RecordType extends Record = Record>(props: T<FormType, RecordType>) => ...
How can we expand the
<FormType extends 'edit' | 'create' = 'create', RecordType extends Record = Record>
from type generics to function generics without having to duplicate the code?