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 get basic styled components with @component annotation jsdoc working #850
Comments
I don't see any warnings in your example with the latest React Styleguidist. |
Thanks for responding. I decided to do the following and still got the same warning.
Besides making sure I have a clean environment and latest react-styleguidist, did you do anything different? Maybe you can guide me on debugging. I'm not sure where to go from here. |
This is not the latest version:
|
Thank you for your help! I didn't think about upgrading rsg npm package in the example. I'm now able to get it working. |
I'm running into this same issue with Styled Components and TypeScript. Any suggestions on what might be going wrong here? Error: https://github.com/glensomerville/react-styled-components-styleguide-ts |
Do you have an example repo that reproduces this issue, or can give more information that would help us understand what might be going on?
… On Apr 10, 2018, at 7:12 AM, glensomerville ***@***.***> wrote:
I'm running into this same issue with Styled Components and TypeScript. Any suggestions on what might be going wrong here?
Error:
Warning: src/components/Buttons/MediumButton/MediumButton.tsx matches a pattern defined in “components” or “sections” options in your style guide config but doesn’t export a component.
https://github.com/glensomerville/react-styled-components-styleguide-ts
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes, the example repo can be found here: https://github.com/glensomerville/react-styled-components-styleguide-ts Thanks for looking into this. |
Oh, and by the way, if I change a direct styled-component export to a SFC, then it is picked up correctly. e.g. instead of exporting a styled element directly, as in https://github.com/glensomerville/react-styled-components-styleguide-ts/blob/master/src/components/Buttons/MediumButton/MediumButton.tsx, it will work if I change it to:
|
Hi @glensomerville were you able to find a fix? I think I'm having the same issue. |
Hey I found an interesting solve for this issue. Using the example from styleguidist's site here: Instead I wrote it like this:
and then the Readme.md file looks like this: SalmonButton example:
|
I tried @spencersmb solution but if you have typescript types in the styled-components (e.j.: export const SalmonButton = styled.button<{ something: true }>` those are not shown in the props/methods section :( |
I'm not sure what I'm doing wrong. It is not picking up my component that is a styled component using annotation.
https://github.com/longility/react-styleguidist/tree/styled-component-example
The text was updated successfully, but these errors were encountered: