TypeScript – Module ‘”*.svg”‘ has no exported member ‘ReactComponent

You have export default content; But you are doing a named import (not a default import).


Change declaration to export the name you are importing:

declare module '*.svg' {
  import React = require('react');
  export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
  const src: string;
  export default src;


Recommend not using files in tsconfig.json. Instead just use include

Leave a Comment