gatsby-plugin-react-svg icon indicating copy to clipboard operation
gatsby-plugin-react-svg copied to clipboard

Dynamic imports

Open haniotis opened this issue 5 years ago • 2 comments

Is there a way to use dynamic imports? I'm trying to achieve something like this:

Icon.js component <Container src={require(`static/icons/${icon}.svg`)} raw />

In use <Icon icon="twitter" />

The idea is to call a single Icon component and just reference the icon names as opposed to importing individual assets

Thanks!

haniotis avatar Feb 21 '20 03:02 haniotis

Hello. Are there any updates on this?

polnikale avatar May 25 '21 15:05 polnikale

Nope! Pull requests welcome!

jacobmischka avatar May 25 '21 15:05 jacobmischka