Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molecule component not recognizing Atom component #156

Closed
higginbg opened this issue Mar 8, 2024 · 3 comments
Closed

Molecule component not recognizing Atom component #156

higginbg opened this issue Mar 8, 2024 · 3 comments

Comments

@higginbg
Copy link

higginbg commented Mar 8, 2024

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
Copy link
Member

muryoh commented Mar 12, 2024

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

@muryoh muryoh self-assigned this Mar 12, 2024
@gqio
Copy link
Member

gqio commented Mar 26, 2024

Hello @higginbg

Did the solution/workaround worked for you ?

Best.

@higginbg
Copy link
Author

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

@muryoh muryoh removed their assignment Mar 28, 2024
@gqio gqio closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants