reactjs / reactjs/react-docgen

feature request. Allow to analyze reexported components

Open
#73 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted idea
Dominant language
TypeScript
Stars
3.8k
Forks
316
Avg merge
5h 7m
Merged PRs (30d)
4

Description

AnyComponent.jsx

import * as React from 'react';

export default class AnyComponent extends React.Component {
    anyMethod(){
       //..
    }
    render(){
       return (<div></div>)
    }
}

Test.jsx

export {AnyComponent} from './AnyComponent';
react-docgen Test.jsx
throws exception "No suitable component definition found"

But should analysis content of AnyComponent.jsx.

What do you think about it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reexport example in Test.jsx and the component definition in AnyComponent.jsx, then run the react-docgen command shown in the issue to reproduce the exception. Trace how the CLI handles the reexport and compare it with direct component analysis. Done means Test.jsx is analyzed without the "No suitable component definition found" error and exposes AnyComponent's documentation data.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.