feat(types): avoid props JSDocs loss by default option (#5871)

This commit is contained in:
Johnson Chu 2022-05-11 19:37:49 +08:00 committed by GitHub
parent 425310e8b6
commit c901dca5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,7 +135,8 @@ const enum BooleanFlags {
// extract props which defined with default from prop options
export type ExtractDefaultPropTypes<O> = O extends object
? { [K in DefaultKeys<O>]: InferPropType<O[K]> }
// use `keyof Pick<O, DefaultKeys<O>>` instead of `DefaultKeys<O>` to support IDE features
? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> }
: {}
type NormalizedProp =