Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Add JetBrains/svg-sprite-loader #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shapkarin
Copy link

@shapkarin shapkarin commented Apr 14, 2020

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

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

```js
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>
  );
};

```
@jsf-clabot
Copy link

jsf-clabot commented Apr 14, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants