Can I "get" the intended HTML element to be rendered?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- documentation
Research direction
No files, tests, or entry points are named; begin by locating the docgen parser or API that extracts React component metadata and its existing test coverage. Done means exposing the rendered native HTML tag alongside the documented prop information, with coverage demonstrating the h1 case.
Written by the indexing model from the issue text.
Description
I would like to document both the props and the HTML element that a react component plans on rendering:
const MyComponent = ({ foo, bar, ...restProps }) => <h1 foo={ foo } bar={bar} {...restProps } />;
MyComponent.propTypes = {
foo: PropTypes.string,
bar: PropTypes.number,
}
In the above example I want to be able to document:
- The props stated in propTypes
- The "native" HTML props that would be valid for an
h1element.
In the docs i wanna say:
"here are the explicitly set props and this component also takes all valid props for HTMLHeadingElement"
Is it possible for us to get the h1 tag from docgen so we can associate that component's documentation with its html tag?
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 316
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 6
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.
More from reactjs/react-docgen
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reactjs/react-docgen#1102 ·
-
Typescript Status Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
reactjs/react-docgen#1005 · 4 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
reactjs/react-docgen#997 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
reactjs/react-docgen#994 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
reactjs/react-docgen#982 · 2 comments ·
All issues in reactjs/react-docgen
Similar issues
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/models.dev#7701 ·