Skip to content

Type Alias: MergeTypeDefault<T, D, P>

ts
type MergeTypeDefault<T, D, P> = unknown extends D ? P : P | D;

Merges a prop type with a default value type. If no default is provided, returns just the prop type; otherwise returns the union.

Type Parameters

Type ParameterDefault typeDescription
T-The prop definition
D-The default value type
PInferPropType<T>The inferred prop type