You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently started using this project, wich is great to build sprite with no hassle!
I don't have any issue, it's more of an idea.
In my project I use React and Typescript.
I created a Icon component which takes a name prop which should be the id of the svg in the sprite I want to use.
interfaceIconProps{name: string}constIcon=({ name }: IconProps)=>{return(<svg><usehref={`icons.svg#${name}`}/></svg>)}
And it works great, but miss one thing. Using typescript it would be amazing to be able to generate a type declaration that would contain all of the id of the svg in the sprite so I would get autocompletion for my name prop and I would be able to create my interface like this:
interfaceIconProps{name: IconIdInSprite}
What do you think ?
The text was updated successfully, but these errors were encountered:
@Kreeg But I think what he wants is generating the interface at runtime, so he will have autocomplete inside the ide. That should be quite easy. @AlexisWalravens This package does it but doesn't have all the features of svg-sprite https://github.com/kreuzerk/svg-to-ts
Hi 馃憢,
I recently started using this project, wich is great to build sprite with no hassle!
I don't have any issue, it's more of an idea.
In my project I use React and Typescript.
I created a
Icon
component which takes aname
prop which should be the id of the svg in the sprite I want to use.And it works great, but miss one thing. Using typescript it would be amazing to be able to generate a type declaration that would contain all of the id of the svg in the sprite so I would get autocompletion for my
name
prop and I would be able to create my interface like this:What do you think ?
The text was updated successfully, but these errors were encountered: