-
Notifications
You must be signed in to change notification settings - Fork 37
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
Added custom icon support for adding new and overriding existing icons. #366
Conversation
// Add default icons on first call. | ||
// For correct overrides; this must run after custom icons have been added. | ||
if (!hasRunOnce) { | ||
hasRunOnce = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make dev mode hot reload not working properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ability to invoke a reset to these properties and added it before the first custom library is called. This allows require.context() calls be reset in dev hot reloading.
packages/Atoms/Icon/icon-library.js
Outdated
@@ -0,0 +1,44 @@ | |||
const iconProps = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In dev mode, hot reload will run code multiple times if you edited the config file, so this global var value may will be kept instead of reset to {}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ability to invoke a reset to these properties and added it before the first custom library is called. This allows require.context() calls be reset in dev hot reloading.
@tim-yao - This is my take on a custom icon solution. I'll try implement on nuxt and see if I can update the other branch.