While integrating Figma with Code Connect, I encountered an issue with prop synchronization for nested components.
I have an IconButton component that conditionally renders a nested Badge component when the Show Badge property is set to true.
The Badge component has the following props:
Variant (Standard / Dot)
Content (only displayed when Variant is set to Standard)
Issue
When updating any of the Badge props in Figma:
- Changing the
Content value
- Switching the
Variant between Standard and Dot
…the changes are not reflected in the generated code via Code Connect (the changes are reflected in Figma).
Expected behavior
Changes made to the nested Badge component props should be propagated and correctly reflected in the generated code.
Actual behavior
The Badge props remain unchanged in the code, even though they are updated in Figma.
Code Connect version: 1.4.0
OS: Ubuntu
Code snippet:
figma.connect(
IconButton,
"figma_url",
{
props: {
disabled: figma.enum("State", {
Disabled: true,
}),
showBadge: figma.boolean("Show badge"),
badge: figma.boolean("Show badge", {
true: figma.nestedProps("<Badge>", {
variant: figma.enum("Variant", {
Standard: "standard",
Dot: "dot",
}),
badgeContent: figma.enum("Variant", {
Standard: figma.string("Content"),
Dot: undefined,
}),
}),
false: { variant: undefined, badgeContent: undefined },
}),
icon: figma.nestedProps("<Icon>", {
name: figma.instance<string>("Icon instance"),
}),
},
example: (props) => (
<IconButton
disabled={props.disabled}
showBadge={props.showBadge}
badgeContent={props.badge.badgeContent}
>
<Icon>{props.icon.name}</Icon>
</IconButton>
),
},
);

While integrating Figma with Code Connect, I encountered an issue with prop synchronization for nested components.
I have an
IconButtoncomponent that conditionally renders a nestedBadgecomponent when theShow Badgeproperty is set totrue.The
Badgecomponent has the following props:Variant(Standard / Dot)Content(only displayed when Variant is set to Standard)Issue
When updating any of the Badge props in Figma:
ContentvalueVariantbetweenStandardandDot…the changes are not reflected in the generated code via Code Connect (the changes are reflected in Figma).
Expected behavior
Changes made to the nested Badge component props should be propagated and correctly reflected in the generated code.
Actual behavior
The
Badgeprops remain unchanged in the code, even though they are updated in Figma.Code Connect version: 1.4.0
OS: Ubuntu
Code snippet: