types(props): Support undefined as default (#3783)

This commit is contained in:
Carlos Rodrigues
2021-05-17 19:04:31 +01:00
committed by GitHub
parent 47da92146c
commit 92e7330385
2 changed files with 13 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ type RequiredKeys<T> = {
// don't mark Boolean props as undefined
| BooleanConstructor
| { type: BooleanConstructor }
? K
? T[K] extends { default: undefined | (() => undefined) } ? never : K
: never
}[keyof T]