https://github.com/maxpoletaev/react-svgdom-loader
Import SVG as ReactDOM element
https://github.com/maxpoletaev/react-svgdom-loader
Last synced: 3 months ago
JSON representation
Import SVG as ReactDOM element
- Host: GitHub
- URL: https://github.com/maxpoletaev/react-svgdom-loader
- Owner: maxpoletaev
- Created: 2015-08-09T13:25:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-26T14:21:51.000Z (over 9 years ago)
- Last Synced: 2025-04-10T18:55:01.624Z (3 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-svgdom-loader [![][build]][build-link]
[build]: https://travis-ci.org/zenwalker/react-svgdom-loader.svg?branch=master
[build-link]: https://travis-ci.org/zenwalker/react-svgdom-loader> Import SVG icons as ReactDOM element!
## Installation
```
npm i --save react-svgdom-loader svgo-loader
```## Usage
Add loader into `webpack.config.js`:
```js
loaders: [{
test: /\.svg$/,
loaders: ['react-svgdom', 'svgo']
}]
```Then use SVG in component:
```js
import React, { Component } from 'react';
import MyIcon from '../icons/my-icon.svg';class MyComponent extends Component {
render() {
return (
);
}
}
```## Query parameters
### className
default: `svg-icon`
### ignoreAttrs
Comma-separated list of attributes for ignoring.
default: `id`
## License
Licensed under the MIT license.