Skip to content

Commit c901dca

Browse files
feat(types): avoid props JSDocs loss by default option (#5871)
1 parent 425310e commit c901dca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-core/src/componentProps.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ const enum BooleanFlags {
135135

136136
// extract props which defined with default from prop options
137137
export type ExtractDefaultPropTypes<O> = O extends object
138-
? { [K in DefaultKeys<O>]: InferPropType<O[K]> }
138+
// use `keyof Pick<O, DefaultKeys<O>>` instead of `DefaultKeys<O>` to support IDE features
139+
? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> }
139140
: {}
140141

141142
type NormalizedProp =

0 commit comments

Comments
 (0)