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
Code Connect CLI version 1.2.2
Operating system Windows 10 Enterprise
Description
When working with a component that has multiple instances of the same child component (in this case, buttons), there's no clear way to distinguish between them when mapping properties using Code Connect.
Current Setup
Parent component: Modal with two button slots (primary and secondary)
Both buttons are instances of the same component, appearing in the Figma UI as identical "Buttons" sections
Each button section has the same property names (Size, Type, etc.)
While visually distinct in the layer panel with different labels, we cannot programmatically target them individually
Attempted Approaches
We've tried several methods to target each button individually:
Using figma.nestedProps('Buttons', {...}) to access button properties
Using figma.children() with layer paths to target specific instances
Attempting to use figma.textContent() to identify by label text
Trying to scope by position in the Footer structure
@tomduncalf-figma - Thanks for the quick feedback! Yes, renaming instances fixed the issue. However, requiring designers to manually rename layers for each instance of repeated components creates maintenance overhead. A more robust API for targeting sublayers would be preferable to relying on specific naming conventions.
Looking forward to the planned API improvements!
Environment
Code Connect CLI version 1.2.2
Operating system Windows 10 Enterprise
Description
When working with a component that has multiple instances of the same child component (in this case, buttons), there's no clear way to distinguish between them when mapping properties using Code Connect.
Current Setup
Attempted Approaches
We've tried several methods to target each button individually:
figma.nestedProps('Buttons', {...})
to access button propertiesfigma.children()
with layer paths to target specific instancesfigma.textContent()
to identify by label textHere's our current implementation:
Current Behavior
Expected Behavior
Ability to target each button instance individually, perhaps by:
Question
What is the recommended approach for handling multiple instances of the same component when they need different property mappings within Code Connect?
Additional Context
The text was updated successfully, but these errors were encountered: