feat: allow passing in only icon SVG data to addIcons #1256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See https://github.com/ionic-team/ionic-framework-design-documents/commit/a12daf314e9fdd6619503e88e9c99d2c184d95b7
This feature allows developers to pass icons to the icon map without explicitly setting the string name. This cuts down on boilerplate and reduces the likelihood of mapping the icon to a typo (i.e.
"log-ionic"
instead of"logo-ionic"
)For backwards compatibility purposes, the camel case key will still be available for developers who are explicitly mapping icon SVG data to camel case keys.
As part of this, Ionicons will now warn if multiple icons are mapped to the same key. TypeScript should prevent devs from explicitly doing this in Objects, but by autogenerating keys this may happen without the developer knowing. A warning will be logged so devs are aware of when this happens.
Usage