Currently, I am utilizing Vue 2 together with Typescript and have defined a type in my types.ts
file:
export type SetupSliderType = {
name: SetupSliderEnum;
image: HTMLImageElement;
title: keyof I18nMessages;
component: Function;
}
No errors are detected with this setup.
Within my RegisterSetup.tsx
file, I have created an Array of that particular type:
private slides: Array<SetupSliderType> = [
{
name: SetupSliderEnum.solutions,
image: <img src={solutions_logo}/>,
title: I18nMessages['account.register.side.subheading'],
component: this.renderSlideSolutions
},
]
I encounter the following error on the 'image' line within my Array block:
Type 'VNode' is missing the following properties from type 'HTMLImageElement': align, alt, border, complete, and 309 more.ts(2740)
types.ts(13, 3): The expected type comes from property 'image' which is declared here on type 'SetupSliderType'
How can I correctly utilize the <img>
element in this syntax or where could I be going wrong?