Comments (5)
Another option is to have a folder of icons whose index.js
required and exported each one:
// 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 />
}
from simplenote-electron.
While this can certainly be done, I don't see the benefit?
from simplenote-electron.
I think @drw158 is trying to reduce the amount of characters to type when putting in icons.
from simplenote-electron.
Doesn't seem like much of a benefit. There aren't that many icons per component.
from simplenote-electron.
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.
from simplenote-electron.
Related Issues (20)
- Delete Account of Muhammad Saleem
- Insert images HOT 1
- Being able to disable IME for an input element
- Extra lines in web interface
- App crashes immediately after opening HOT 1
- Password Change Breaks Logout Button
- Simplenote Freezes When the User Attempts to Import Improperly Formatted JSON HOT 1
- Passcode Lock Screen HOT 2
- The character counter counts the new line as two characters
- Adding `Folders` for clubbing notes for similar topics HOT 1
- Searching of URLs not reflected in sidebar
- Edit keyboard shortcuts
- Update vulnerable dependencies
- Slow start up on windows 10
- Readonly Public Sharing with search optiopn HOT 4
- Is there different view options?
- 500 Error when attempting Simplenote web app login HOT 1
- Share Notes with Search Option -> Share All Notes or Sub-Notes Option or Folder Option
- Characters repeating during input in Android App
- simplenote (snap) only starting up with sudo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplenote-electron.