This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Accept undefined as prop when exactOptionalPropertyTypes is enabled in tsconfig #12859
Labels
You can continue the conversation there. Go to discussion →
Vue version
3.5.12
Link to minimal reproduction
https://github.com/amritk/vue-exact-optional-property-types
Steps to reproduce
Create a component like so
enable
exactOptionalProperties
in tsconfigWhat is expected?
You should be able to pass undefined into the prop as you can in typescript
What is actually happening?
It gives an error saying undefined is not assignable to string. However we have a default set so it will end up being a string.
System Info
Any additional comments?
Is there a way to get this to work like it does in typescript without explicitly setting the type
| undefined
The text was updated successfully, but these errors were encountered: