Closed jsonchou closed 5 months ago
@jsonchou At the moment, there is nothing similar, which I think would be a good feature for a future version. This is very common, especially when you want to create conditions that render a specific icon.
I'm looking at it, but the major problem is that the SVG is not separated from the React component, making it difficult to extract in order to use it in another component.
It looks like it needs an architectural rework :
Seem the right way to do it, but I may be wrong. Plus, I think that importing SVGs like that may a bit tricky or require other library like react-svg-loader
This will need to pack all icons into your build. It's not a good practice.
<SpecificIcon name="react" {...props} />
You can use CDN links instead as a workaround.
Or use the https://npmjs.com/simple-icons directly.
Yes, this will lose the function of Tree Shaking. I request to close this issue. @wootsbot
Hi, Is there a way to get icon component by specific enum name?