Closed affanshahid closed 4 years ago
I can verify that any type declared in a different file shows up as any
.
I can verify this is also happening to me
@affanshahid I don't know if it's related, but with this:
type Type = 'default' | 'action' | 'destroy'
export interface ButtonProps {
label?: string
type?: Type
}
I get the following:
Instead of this:
this is different @affanshahid I think but I would like this as well! I have union types defined that I use in multiple places,
export type TextColors = 'DEFAULT' | 'DISABLED';
and I just see TextColors
as the description.
I'm having a similar problem with union types but if I set the property as optional it expands the type...
Setting shouldExtractLiteralValuesFromEnum
to true
in the loader options fixed for me.
🎉
For support for enums, some info can be found here: https://github.com/strothj/react-docgen-typescript-loader/issues/87
For loading types from external files: https://github.com/strothj/react-docgen-typescript-loader/issues/80
The documentation was recently updated to include instructions on supporting files loaded from external files. I'm closing this issue but feel free to leave a comment if this is still a problem.
So I am importing a type from another file and using that as a type in one of my prop declarations:
I get the following:![image](https://user-images.githubusercontent.com/17955210/62389145-711deb80-b578-11e9-93d9-beeca3671ce1.png)
Notice the
any[]
. Am I doing something wrong?