Turn your svg files into React components, allows for:
import { Star } from './components/icons';
const App = () => (
<div>
<Star />
</div>
);
or
import * as Icons from './components/icons';
const App = () => (
<div>
<Icons.Star />
</div>
);
To create icons:
const componentiser = require('svg-to-components');
componentiser.create({
src: 'my/src/dir',
output: 'my/out/dir'
});
svg-to-react --src images --output output/dir
svg-to-react --help
Inspired by https://github.com/pedronauck/reicons#readme re-written with async/await, less dependencies, and tests
yarn install
yarn test
yarn test:command
Make it recursive (optionally)