JSPM

svg2react-loader

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q47291F
  • License MIT

A Webpack Loader to turn SVGs into React Components

Package Exports

  • svg2react-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svg2react-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

SVG to React Loader

A Webpack Loader to turn SVGs into React Components

Fork from: https://github.com/jhamlet/svg-react-loader, and make it simple.

Installation

npm install svg2react-loader

##Usage

var React = require('react');
var Icon = require('babel!svg2react!./my-icon.svg?name=Icon');

module.exports = React.createClass({
    render () {
        return <Icon className='normal' />;
    }
});