-
Notifications
You must be signed in to change notification settings - Fork 252
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
displayName
appears to be ignored
#82
Comments
I am not sure if this is wrong thing. Does styleguidist (with js only) use display name instead? I see display name more as the friendly name for debugging. Am I wrong? |
i consider this a bug since i am using another library that i use together with if i have js component and document it with i think current behaviour is not correct and fixing it should do no harm. tried to PR this but didn't finish yet, don't know typescript compiler well enough so stumbling around. ill try to find more time to tackle this |
I'm having the same problem. Styleguidist uses react-docgen to parse props by default. I'm using Styleguidist and for .js files, I'm able to set the
It's because react-docgen-typescript/src/parser.ts Line 221 in d6eab26
react-docgen-typescript/src/parser.ts Line 207 in d6eab26
react-docgen-typescript/src/parser.ts Lines 566 to 570 in d6eab26
See how it gets set to the filename, At the minimum, we should be able to set Styleguidist also has |
Due to a bug / strange behaviour from one of our dependencies (react-docgen-typescript) used to generate docgenInfo for components, in how it assigns displayName to components, components used directly by the Guideline-app needs to be exported as classes instead of as function constants / StatelessComponents after updating outdated package-lock.json file. Ref open issue in react-docgen-typescript: styleguidist/react-docgen-typescript#82
@dosentmatter hello, thanks for thorough explanation so the order should be like so:
in other words, im going to work on this today, hopefully with some results :) |
Hey @argshook. Yeah, I think
|
react-docgen-typescript
seems to not considerdisplayName
property. moreover, it uses filename as displayName, which (for me) usually is wrong.here's function in question:
https://github.com/styleguidist/react-docgen-typescript/blob/master/src/parser.ts#L555
i would expect
Component.displayName = 'hello'
orstatic displayName = 'hello'
to be used when available.related to #72
The text was updated successfully, but these errors were encountered: