Open haniotis opened 4 years ago
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 />
<Container src={require(`static/icons/${icon}.svg`)} raw />
In use <Icon icon="twitter" />
<Icon icon="twitter" />
The idea is to call a single Icon component and just reference the icon names as opposed to importing individual assets
Icon
Thanks!
Hello. Are there any updates on this?
Nope! Pull requests welcome!
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 assetsThanks!