I have React, Typescript, svgr. Everything looks ok.
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
import Logo from 'assets/icons/logo.svg';
<Logo className={iconClassName} />;
TS doesn't like it.
TS2322: Type '{ className: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'className' does not exist on type 'IntrinsicAttributes'.
What should I do about it?
Thanks!
PS Interesting! When I import {ReactComponent as Logo}
- I don't have errors anymore.
Think you cannot give className to components like that without using props. What I would suggest you to do is as follows: