Skip to content
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

[gatsby-transformer-react-docgen] - TypeScript generated docs missing properties from interface #11650

Closed
dgutride opened this issue Feb 8, 2019 · 7 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: upstream Issues outside of Gatsby's control, caused by dependencies

Comments

@dgutride
Copy link

dgutride commented Feb 8, 2019

Summary

When generating documentation from a component written in typescript, it works much better since the 3.0.3 release, but props from the interface are missing and only props set as default props are referenced. Is there an issue to track the ongoing work to update to the latest react-docgen?

In the example below, only className and src show up in the allComponentMetadata props object (and type is missing, too).

const defaultProps = {
className: '',
src: ''
}
export interface MyComponentProps
/** Additional classes added to the comp. /
className?: string;
/
* Attribute that specifies the URL of the image. /
src?: string;
/
* Attribute that specifies the alt text of the image */
alt: string;
}

MyComponent.defaultProps = defaultProps;
export default MyComponent;

Relevant information

Environment (if relevant)

File contents (if changed)

gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A

@gatsbot gatsbot bot added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Feb 8, 2019
@sidharthachatterjee sidharthachatterjee added type: feature or enhancement and removed type: documentation An issue or pull request for improving or updating Gatsby's documentation labels Feb 8, 2019
@sidharthachatterjee
Copy link
Contributor

Just tried this out locally. It does seem that gatsby-transformer-react-docgen doesn't take props declared as interfaces into account.

@sidharthachatterjee
Copy link
Contributor

On deeper inspection, it seems that react-docgen doesn't support TypeScript at the moment. The relevant issue is at reactjs/react-docgen#325

@sidharthachatterjee sidharthachatterjee added type: upstream Issues outside of Gatsby's control, caused by dependencies and removed type: feature or enhancement labels Feb 8, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 1, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 1, 2019
@dgutride
Copy link
Author

dgutride commented Mar 1, 2019

Replying to keep this open

@gatsbot
Copy link

gatsbot bot commented Mar 12, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Mar 12, 2019
@ColeTownsend
Copy link
Contributor

Not stale

@ColeTownsend ColeTownsend reopened this Oct 21, 2019
@gatsbot
Copy link

gatsbot bot commented Nov 1, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: upstream Issues outside of Gatsby's control, caused by dependencies
Projects
None yet
Development

No branches or pull requests

3 participants