divriots / story-to-design

Keep your Figma libraries true-to-code in a single click.
https://story.to.design
26 stars 0 forks source link

Molecule component not recognizing Atom component #156

Open higginbg opened 3 months ago

higginbg commented 3 months ago

After importing a Button atom and then a ButtonGroup molecule, Figma is not recognizing that the Button atom is in the molecule. I am only able to change the ButtonGroup variants and not the Button variants.


Bug report identity: Please do not edit

Task path: FfUBIcwJEI7Efd6DXJE2/3jybI6W31JBPf64Lg3A2/h7sxmw3x82r9

muryoh commented 3 months ago

Hi!

As quickly discussed over Discord, the problem is we currently cannot properly identify React components that do not have a displayName set which is the case here

Workaround for now is to manually set a displayName, eg:

export const Icon = (props: IconProps) => {
  const { icon, ...otherProps } = props;
  const IconClass = iconsMap[icon];
  return <IconClass {...otherProps}></IconClass>;
};

Icon.displayName = 'Icon';

Not sure if there's something better we can do on our side, will see with the team

Cheers Remy

gqio commented 3 months ago

Hello @higginbg

Did the solution/workaround worked for you ?

Best.

higginbg commented 3 months ago

Hi @gqio, yes the displayName ended up being the issue. Thank you.