Replies: 1 comment
-
Am looking for similar question for non SVG props so as I'm here I think I can help answer this. The template uses a props spread on the svg element so you can just pass in opacity where you need to set it and not try to replace it with // Inside the template
<svg {...props}>...</svg>
// Using an svgr generated Component
<MySvgIcon opacity="0.2" /> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I'm generating Typescript icons, I get something like this:
Using the
replaceAttrValues
, I can get something like this:But then I need to have it generated like this:
I see in your sourcecode that this is something that can be achieved by
expandProps
, but I didn't find how exactly add the list of additional props. I ended up with rewriting thetemplate
:as you see, simplifying the part where
variables.props
were, as pulling whole babel libraries and making all the magic of creating newt.Identifier(... t.intersectionTypeAnnotation([variables.props.typeAnnotation, ...]) )
is way too much for a simple SVG package of my project.Is there a way to do it simpler, or can you add another parameter into the config?
Beta Was this translation helpful? Give feedback.
All reactions