title: Import SVG in TypeScript React app with Webpack
body: <p>I'd like to import an SVG image into a little React app written with TypeScript and bundled with Webpack. The problem is that that no image is shown (only the browser's fallback image that no image was found). It seems like the data URL is wrong, because when I copy the data URL in a base64 decoder the image is broken.</p>
  
  <p>I'm tried different Webpack loaders (url-loader, file-loader, svg-loader, ...)</p>
  
  <p><code>webpack.config.json</code></p>
  
  <pre><code>module: {
    rules: [
      {
        test: /\.svg$/,
        loader: 'url-loader'
      }
    ]
  }
  </code></pre>
  
  <p><code>tsd.d.ts</code></p>
  
  <pre><code>declare module "*.svg" {
    const content:string;
    export default content;
  }
  </code></pre>
  
  <p><code>App.tsx</code></p>
  
  <pre><code>import content from './logo.svg';
  
  class App extends React.Component {
    render() {
      &lt;div&gt;
        &lt;img src={content} /&gt;
      &lt;/div&gt;
    }
  }
  </code></pre>
  
  <p>Any ideas what to change?</p>
  
  <p>Thanks in advance!</p>