Skip to content

Type Alias: MergeDefault<T, D, P>

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

Merges a prop type with a default value, making the prop type non-nullable.

Type Parameters

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