Настройка импорта svg картинок

PHOTO EMBED

Fri Jul 22 2022 10:05:54 GMT+0000 (UTC)

Saved by @happy_cutman #react.js #typescript

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

// tsconfig
"include": [
    "src",
    "custom.d.ts"
  ]
content_copyCOPY