开发者社区> 镜像站> NPM> svg2react-loader
svg2react-loader
A Webpack Loader to turn SVGs into React Components
Last updated 2 years ago by onbing .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install svg2react-loader 
SYNC missed versions from official npm registry.

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' />;
    }
});

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

5 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (2)
Downloads
Today 0
This Week 15
This Month 13
Last Day 2
Last Week 17
Last Month 50
Dependencies (3)
Dev Dependencies (10)