New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine all icons into one file? #73
Comments
Another option is to have a folder of icons whose // icons/index.js
import Trash from './trash'
import Back from './back'
import Plus from './plus'
export { Trash, Back, Plus } Then where you're using them you could import only what you were using: import { Trash } from './icons'
render() {
return <Trash />
} Or reference all of them: import * as Icons from './icons'
render: function() {
return <Icons.Trash />
} |
While this can certainly be done, I don't see the benefit? |
I think @drw158 is trying to reduce the amount of characters to type when putting in icons. |
Doesn't seem like much of a benefit. There aren't that many icons per component. |
Yep, the main benefit is reducing the amount of work when creating new components. Instead of searching for the icon you need, looking up the icon name, and then adding an import for each one, you could just import the entire set. Beau's solution would probably be better for long term than what we have now. It's not a lot of trouble now because we only have a handful of icons, but it's possible that we'll add more. If it becomes cumbersome, we can reopen this issue. |
This would make requiring icons easier. Instead of requiring each icon one by one, we could just require one component.
For example:
Not sure how to do this though, it's a bit over my head.
The text was updated successfully, but these errors were encountered: