Title says it all really - I’m having issues with compilation as Typescript says ‘url’ isn’t a property of responsiveImage, even though it works as intended:
Failed to compile.
./components/CV/Components/Company.tsx:20:38
Type error: Property 'url' does not exist on type '{ responsiveImage: ResponsiveImageType; }'.
18 | skill => (
19 | <div className={Styles.icon} key={skill.id}>
> 20 | <img src={skill.icon.url} alt={skill.name} title={skill.name} />
| ^
21 | </div>
22 | )
23 | )}
info - Checking validity of types .The terminal process "/bin/zsh '-c', 'npm run build'" terminated with exit code: 1.
The responsiveImage is ‘icon’. I’m using ‘url’ property as these images are SVGs and couldn’t seem to get them working otherwise.
I realise I can get Typescript to ignore the issue, but wanted to learn of any better way to use an SVG without losing type safety.
Thanks