-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PropsTable does not render #227
Comments
I had the same issue. The problem was import line for 'react'. |
Same bug here, only worked with @mrac suggestion. It's possible that Docz, or other dependencie that handle the PropsTable, don't work with the following TypeScript setting?
This setting allows to use |
You guys are right that Right now I'm searching if there is a way to override the tsconfig to set this option to true like I have in my main project as well. As soon as I have found a solution I'll post back here. I find people mentioning the exact same thing in the React Docgen Typescript repo where I feel this issue is coming from: styleguidist/react-docgen-typescript#100 |
I already had What did the trick, was changing the default exported element with lowercase instead of PascalCase. so, this didn't render the table:
but this did:
I would still rather use camelcase for my constants, any chance to solve this? |
@markusoelhafen That's actually very strange. For me it did work with PascalCase. But I also notice that you are using a functional component, which I didn't. Maybe that also makes a difference. |
Try changing I believe the package |
Hey @strothj , |
I haven't had the time to try named exports, I'll assume that works. But still one might want to have default exports, since this is a pretty common thing. I don't like changing my code base for a specific tool I use to render documentation. So I'm still hoping someone will pass by with the solution that works in all cases 😄 |
Hey @JeroenReumkens, Now that it works I'm pretty happy with docz :) |
@markusoelhafen Yeah exactly, so you just do both? Still not totally comfortable with the solution, since other developers constantly need the explanation why we do that. |
@JeroenReumkens Gave it a quick try, but didn't work with import |
If I'm not mistaken, adding an additional named export along with the default may work. That way you can continue to use the default export but the parser will be able to attach the docgen information to it. After processing the file with the parser (react-docgen-typescript),
|
I've just tried to get it to work, but unfortunately it didn't. I even tried making a very small component (tried but functional and class), which also didn't work. Example:
The difference might be that I'm using the babel-6 plugin? I have planned to upgrade that in the coming weeks, but it would be great if I could get Docz running before that. |
I am not using Typescript in my project. What is the solution to using |
Please guys, can you test with the new release... I think that this was fixed! |
Thanks for the update, @pedronauck. It still doesn't render in my case (using with Styled Components - as discussed in #156). I saw some people mentioned they'd start working on that but I didn't see any further updates about it. Are you working with them to make docz compatible with styled components? Do you need any help/is there a way to collaborate? |
Hey, I was testing the same thing yesterday. Didn’t render either 😢 I’m not using styled components but do use Typescript, and Babel 6. For the latter I read there were some problems with, so i’m trying to upgrade to Babel 7 and will test again after that. But that is going to take a few days before I can test that. Thanks for all the hard work @pedronauck ! |
@wceolin if you want to out styled-components together right now, you can do something like we're doing on our styled-components example |
@pedronauck Thanks, I had seen that example but I'm trying to figure out a solution without having to update all components 😅 |
I'll close this issue in favor of #240, since both is related to pass custom configuration to react-docgen resolver! |
Having the same issue as @wceolin |
I've tried ex) Button folder has
but doesn't render prop table... |
Bug Report
PropsTable did not render anything in the screen. (cc #138)
I'm using TypeScript.
To Reproduce
Expected behavior
Render PropsTable, getting props from TypeScript interface automatically
Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: