code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

[React] Not linking correctly when used at other files

Open Sh031224 opened this issue 1 year ago • 0 comments

Problem

In the file where we created the component, the code is displayed as we intended.

스크린샷 2024-11-07 오후 4 23 40

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.

image

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.

image

We designed the Icon/Icons component to allow us to swap icon instances freely.

image

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.

스크린샷 2024-11-07 오후 4 23 40

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]

Sh031224 avatar Nov 07 '24 08:11 Sh031224