reactjs / reactjs/react-docgen
Typescript generic class component props not parsed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 316
- Avg merge
- 5h 7m
- Merged PRs (30d)
- 4
Description
Consider the example component below which is very common.
I cannot parse the props.
am i doing something incorrect here?
please copy paste in the playgrounds and try it for yourselves. https://reactcommunity.org/react-docgen/
import React, { Component } from 'react';
interface Props {
/**
* name of person
*/
name: string;
}
class MyComponent<T extends Props> extends Component<T> {
render() {
<p>hello</p>
}
}
export default MyComponent;
I expect to get the props parsed for this component from the interface 'Props' But no props are parsed.
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
Start by pasting the provided TypeScript generic class component into the react-docgen playground and compare the parser output with the expected Props interface. Investigate the parsing entry point for class component props and confirm the work is done when the documented name prop is extracted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100