gatsby-plugin-react-svg
gatsby-plugin-react-svg copied to clipboard
Dynamic imports
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!