code-connect
code-connect copied to clipboard
[React] Not linking correctly when used at other files
Problem
In the file where we created the component, the code is displayed as we intended.
But if we create another file and then load the component we created, the code doesn't show up at all.
We add a detailed description because it's only happening with our specific component.
More Detail Info
Design
First, we defined the Icon Assets as follows.
We then created an additional masked component as Icon/Icons so that when using the icon, it would retain its existing color even if we changed to a different icon.
We designed the Icon/Icons component to allow us to swap icon instances freely.
Develop
We connected the code as follows.
// Icon Asset
figma.connect(IconBlank, '<FIGMA_ICONS_BASE>?node-id=7-264', {
variant: { Name: 'blank' },
example: () => <IconBlank />,
});
// Icon/Icons
figma.connect(IconBlank, '<FIGMA_ICONS_BASE>?node-id=501-7411', {
variant: {
Icon: '5:1981',
},
example: () => <IconBlank />,
});
Result
Icon Asset worked as intended.
However, the code doesn't show up at all at Icon/Icons.
Version Info
- Code Connect CLI version [1.2.2]
- Operating system [Mac OS 14.5]