DEV Community

loading...

Discussion on: How to create an extremely reusable Icon component with react-svg

Collapse
jfbrennan profile image
Jordan Brennan • Edited

"extremely reusable" and "React" is a contradiction though because it's only usable in a React stack. React, although popular, can't come close to the level of reusability a standards-based solution like custom HTML tags or Custom Elements provides. React, Vue, Riot, etc. are wonderful for structuring your app and managing state changes, but little components like icons are best done with simple, lightweight solutions that aren't tied to a framework.

Collapse
vtrpldn profile image
Vitor Paladini Author

Hey, Jordan. I'm assuming in this article that the reader is already working on a React environment, but your comment made me realize that I should have made that more clear. Thanks for the feedback!

By no means anyone should import React exclusively to create a single icon component, you're absolutely right about that. But in the React context, I'd say these Icons are indeed very much reusable.

Forem Open with the Forem app