Mixins props is marked as required by typescript even tho I defined it as optional
See original GitHub issueimport PropTypes from 'vue-strict-prop';
export const textXsCenterMixin = {
props: {
textXsCenter: PropTypes(Boolean).optional,
},
};
const Flex = componentFactory.mixin(textXsCenterMixin).create({ //...
Typescript complain Property 'textXsCenter' is missing in type
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
New way to define props and emits options #447 - GitHub
I think we need to provide a way to define props options as same as basic Vue even if we can omit them....
Read more >Prop is marked as required in component, but its value is ...
In console, I am getting an error : Warning: Failed prop type: The prop item is marked as required in Details , but...
Read more >Documentation - Mixins - TypeScript
Using the mixin pattern with TypeScript. ... To get started, we'll need a class which will have the mixins applied on top of:...
Read more >Documentation - Do's and Don'ts - TypeScript
Optional Parameters in Callbacks ... This has a very specific meaning: the done callback might be invoked with 1 argument or might be...
Read more >Documentation - TypeScript 4.0
To deepen the connection between parameter lists and tuple types, the syntax for rest elements and optional elements mirrors the syntax for parameter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@chanlito If you want to use props in mixin, you must use
tsx.component
with mixin declaration.@wonderful-panda That works! Cheers.