Good day!
Similar to #215, our designer is also using Icons as children instead of instance swap properties.
Is it possible to use the getProps on this result to get the properties of this mapped instance?
Figma

What I'd like to do
figma.children('*').getProps<{ name: string }>()
Similar to
figma.instance('icon').getProps<{ name: string }>()
Note: when there is an instance swap property, figma.instance('icon').getProps<{ name: string }>() does work but this specific component in Figma does not have one.
What it looks like now
<Badge icon={<Icon icon="IconName" size={16} />} />
What I would like it to be
<Badge icon="IconName" />
Please provide:
- Code Connect CLI version [use npx figma -V if using React, or figma -V otherwise, to get the version of your CLI]
- Operating system
Thanks for the help!
Good day!
Similar to #215, our designer is also using Icons as children instead of instance swap properties.
Is it possible to use the
getPropson this result to get the properties of this mapped instance?Figma
What I'd like to do
Similar to
Note: when there is an instance swap property,
figma.instance('icon').getProps<{ name: string }>()does work but this specific component in Figma does not have one.What it looks like now
What I would like it to be
Please provide:
Thanks for the help!