use svg in gatsby

C++
npm install --save gatsby-plugin-react-svg

# yarn 

yarn add gatsby-plugin-react-svg

// In your gatsby-config.js

plugins: [
  {
    resolve: "gatsby-plugin-react-svg",
    options: {
      rule: {
        include: /assets/ // See below to configure properly
      }
    }
  }
];
Source

Also in C++: