jacobmischka/gatsby-plugin-react-svg

Dynamic imports

haniotis opened this issue · 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!

Hello. Are there any updates on this?

Nope! Pull requests welcome!