awesome-webpack icon indicating copy to clipboard operation
awesome-webpack copied to clipboard

Add JetBrains/svg-sprite-loader

Open shapkarin opened this issue 4 years ago • 1 comments

SVG Sprite Loader

Hello. I was using this plugin for some time and it's seems to be useful and handy. I use it in that way:

import React from 'react';

const svgModules = require.context('Images/sprite', false, /\.svg$/);

svgModules.keys().forEach(svgModules);

const Icon = function ({ name, ...rest }) {
  return (
    <svg {...rest}>
      <use xlinkHref={ `#${ name }` } />
    </svg>
  );
};

shapkarin avatar Apr 14 '20 14:04 shapkarin

CLA assistant check
All committers have signed the CLA.

jsf-clabot avatar Apr 14 '20 14:04 jsf-clabot