Вставить svg в код GatsbyJS
Установить плагин
npm install --save gatsby-plugin-react-svgВставить In your gatsby-config.js
Вызвать компонент из кода
Last updated
Was this helpful?
Установить плагин
npm install --save gatsby-plugin-react-svgВставить In your gatsby-config.js
Вызвать компонент из кода
Last updated
Was this helpful?
Was this helpful?
plugins: [
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /assets/ // See below to configure properly
}
}
}
];import Icon from "./path/assets/icon.svg";
// ...
<Icon />;