reactjs / reactjs/react-docgen
Better support for custom types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 316
- Avg merge
- 5h 7m
- Merged PRs (30d)
- 4
Description
This is more of a "would you be willing to accept a pull request which does this?" question than an issue of sorts. :)
I would really like to extend the functionality of "custom" types so that:
- We support destructured imports (Eg.
PropTypes.array- note the lack ofReact.) - We allow common react-esque prop type function patterns to be picked up with custom props in the same way that
arrayOfis currently handled. (Eg.PropTypes.iterableOf(PropTypes.record(User)))
Basically I feel the library should be able to support custom user prop types in such a way we don't have to reparse the raw value which would mean anyone can easily implement simple custom prop types and create documentation from that.
Custom prop types are super useful in building a real-world app with React and so I would like to see how we can help developers document these too.
We, at Lystable, want to build an open living component docs solution and are hoping react-docgen can feature at the core!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by locating the existing custom prop-type handling and the code path that handles arrayOf, then determine how destructured imports and nested custom functions are represented. Done means both requested patterns are documented without reparsing the raw value, with coverage for the examples given.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100