Closed suresh-gangumalla closed 6 days ago
Hey @suresh-gangumalla , I tested it with the following code but I am getting an error on props
property key:
export default Blits.Component('MyComp', {
template: `
<Element x="400" y="100" />
`,
props: [
'itemA',
'itemB',
{
key: 'itemC',
required: true,
default: 'default value',
},
'itemD',
],
hooks: {
ready() {},
},
})
The error:
Type '(string | { key: string; required: true; default: string; })[]' is not assignable to type 'AdvancedProp[] | PropsArray<string>'.
Type '(string | { key: string; required: true; default: string; })[]' is not assignable to type 'AdvancedProp[]'.
Type 'string | { key: string; required: true; default: string; }' is not assignable to type 'AdvancedProp'.
Type 'string' is not assignable to type 'AdvancedProp'.ts(2322)
component.d.ts(397, 5): The expected type comes from property 'props' which is declared here on type 'ComponentConfig<string, State, Methods>'
@suresh-gangumalla Ignore my previous comment, there was an unrelated issue with my test setup. I tested again and the fix does not have an issue.
Observed typescript error while adding normal string props and advanced props in a component props key.
Allowing only one kind of keys but not both