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

Props not displayed from an interface imported from a .tsx file #43

Closed
jrwebdev opened this issue Sep 4, 2017 · 6 comments
Closed

Props not displayed from an interface imported from a .tsx file #43

jrwebdev opened this issue Sep 4, 2017 · 6 comments

Comments

@jrwebdev
Copy link
Contributor

jrwebdev commented Sep 4, 2017

version 1.0.0

When importing props from a file with a .tsx extension, the props are not displayed. Example:

// Component2.tsx
export interface Component2Props {
  prop1?: string;
  prop2?: number;
}
// Component1.tsx
import { Component2Props } from './Component2';

export interface Component1Props extends Component2Props {
  prop3?: string;
  prop4?: number;
}

In the above example prop1 and prop2 are not displayed. Happens even if the only thing in Component2.tsx is the interface, therefore doesn't appear to be related to React being imported or a component being exported in the same file. Also happens if the props are imported from a .tsx file and are used as-is (i.e. not extended).

Works fine if the inherited props are housed in the same file or imported from a .ts file.

@jrwebdev jrwebdev changed the title Inherited props not displayed from an interface imported from a .tsx file Props not displayed from an interface imported from a .tsx file Sep 4, 2017
@jrwebdev
Copy link
Contributor Author

jrwebdev commented Sep 4, 2017

I have written a failing test here:

https://github.com/jrwebdev/react-docgen-typescript

I had a quick look but I don't have much experience of TypeScript's AST so I'm struggling to find the root cause and don't have the time at the moment to dig further into it.

pvasek added a commit to pvasek/react-docgen-typescript that referenced this issue Sep 8, 2017
@pvasek
Copy link
Collaborator

pvasek commented Sep 8, 2017

@jrwebdev Thanks for your test.

Released version v1.0.1 which includes the fix.

@pvasek pvasek closed this as completed Sep 8, 2017
@besrabasant
Copy link

I do not think that is fixed. I am still not able to see my extended props documentation.

@reetou
Copy link

reetou commented Jun 3, 2018

Same. Trying to use it without react-styileguidist, no props displayed in .tsx file.

@etylsarin
Copy link

Having the same issue.

@fagsoft1
Copy link

Me too. Imposible to find out how to expose imported interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants