Description
Version
3.0.5
Reproduction link
https://codesandbox.io/s/stoic-hamilton-t8cft?file=/src/index.ts
Steps to reproduce
Access props via setup()
block or use ExtractPropTypes
utility to check props type inference (reproduction link has a naive example).
What is expected?
Props with a default
property configured shouldn’t be marked as required by TS.
Edit: Seems like maybe I misunderstood the purpose of said utility. ExtractPropTypes
is giving type safety to props
argument, but not for objects that are safe to be bound to components with such properties.
Maybe there should be another utility that yield proper types from the binding perspective (as in, marking props with default
properties as optional).
What is actually happening?
RequiredKeys<>
TS utility is marking props that have default
property as required (even if they are explicitly configured with required: false
).