Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Instance props (getProps) when using figma.children() #247

Open
blabute opened this issue Feb 18, 2025 · 1 comment
Open

Accessing Instance props (getProps) when using figma.children() #247

blabute opened this issue Feb 18, 2025 · 1 comment

Comments

@blabute
Copy link

blabute commented Feb 18, 2025

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

Image

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]
    • 1.2.4
  • Operating system
    • macOS 15.2 (25C101)

Thanks for the help!

@blabute
Copy link
Author

blabute commented Feb 18, 2025

This is similar to #215 but i am unsure if this will be resolved at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant