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
fix(Documentation, prop-types) Problems with propTypes. #1377
Comments
Yes, please Docs are in bad shape based on all of the feedback, but with the limited time I have, they are the last thing on the list (since they don't enhance or fix the library itself). |
@TheSharpieOne I will start this task. |
@TheSharpieOne 1. Use react-docgen via babel and webpack-loader.
Will show props declared in the current file. 2. Use runtime runs to extract via NodeJS to generate JSON with all meta, via prop-type mutation. extract-types.js
but we need proxy prop-types. And we need to read the description from class:
3. Use TypeScript. Overall:
The third option is better, but need more time and will solve many problems. Other ways are hacky or partial. I like the third. |
Adding .d.ts seems like the same problem: having two difference places to define the props. We just move it from the docs itself to somewhere else to generate the docs. I wish the first option was better. Not only does it not like spread, but it also don't like propTypes from any imported files. We define a couple prop types in a common file and just import them where needed rather than define them everywhere (such as DOMElement and tag), those would have problems with the first option as well (according to reactjs/react-docgen#33). I suppose adding .d.ts in the project would be a good thing as long as it stays up to date with the actual components. |
Now I'm working on the first way. |
Issue description
Many components have actual descriptions and props(but defined in parent component).
Errors in tests:
Documentation mistakes.
Suggestions
Generate table for site/documentation https://github.com/pedronauck/docz with
<PropsTable of={Button} />
Playground via docz ?
docs via mdx?
If we will have correct prop-types and descriptions in one place, it will help us support and understand library better in future.
Do you need pull-request?
The text was updated successfully, but these errors were encountered: