I have a Next.js / Typescript project and I am converting that to a React.js/ Typescript project.
In next js project everything works fine.
import PdfIcon from "assets/svg/pdf-3.svg";
<PdfIcon className={classNames(styles.pdfIcon)} />
types.d.ts
declare module "*.svg" {
import { ReactElement, SVGProps } from "react";
const content: (props: SVGProps<SVGElement>) => ReactElement;
export default content;
}
And then if I put the mouse cursor over the import
But for the React.js project svg take as a string
Still, I use the same types.d.ts file.
What could go wrong here?