I have a React project written in JS that I am converting to TS. Using JS, this works:
import { ReactComponent as IconPerson } from '../../../icons/person.svg';
Using TS, I get this error:
Cannot find module '../../../icons/person.svg' or its corresponding type declarations.
I have added the following to a new index.d.ts file:
declare module '*.svg';
I have also added the index.d.ts file to the include
array in my tsconfig.json:
{
include: ["src", "**/*.ts", "**/*.tsx", "index.d.ts"]
}
What am I missing?