Closed csutorasr closed 1 year ago
Suggested changes:
Add the type to the generated AST. https://github.com/ngneat/svg-icon/blob/4ac9f23016d7b40d57c90a9879ff3cc3fc07c267/svg-generator/ast.ts#L14
Add documentation to the Readme.MD how to add strictly typed components.
You're welcome to submit a PR
The keys now fully typed in v5 using the generator
I'm submitting a...
Current behavior
Icon types are not generated.
Expected behavior
Having the ability to get the names from the objects.
Minimal reproduction of the problem with instructions
IconNames
is astring
instead of array of const strings ('icon1' | 'icon2'
).What is the motivation / use case for changing the behavior?
Using a wrapper component you can strictly type the icons. This means intellisense help, also.
To achieve this you need to wrap the original component.
Solution:
Strictly-type the name in the generated files: