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

Can't use with Emotion (No suitable component definition found) #19

Closed
stereobooster opened this issue May 15, 2020 · 0 comments
Closed

Comments

@stereobooster
Copy link

stereobooster commented May 15, 2020

I use Emotion to create new components, for example:

export const BaseButton = styled.button`
  border: none;
  padding: 0;
  width: auto;
  overflow: visible;
  background: transparent;

  /* inherit font & color from ancestor */
  color: inherit;
  font: inherit;

  /* Normalize line-height. Cannot be changed from normal in Firefox 4+. */
  line-height: normal;

  /* Corrects font smoothing for webkit */
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;

  /* Corrects inability to style clickable input types in iOS */
  -webkit-appearance: none;

  /* Please provide appropriate focus styles */
  :focus {
    outline: none;
  }

  /* Remove excess padding and border in Firefox 4+ */
  &::-moz-focus-inner {
    border: 0;
    padding: 0;
  }

  cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")};
`;

But this component can't be detected by Zeplin command (react-docgen).

I use TypeScript, so it is possible to figure out this is React component based on type infor

Screenshot 2020-05-15 at 10 38 34

As an intermediate solution I would agree to have an option to detect name of component based on filename and skip properties parsing, because typically people have one component per file and same name for file and component.

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

1 participant