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

Incorrect Display of Custom Type Attributes in Documentation #487

Open
frhandlee opened this issue Aug 3, 2023 · 5 comments
Open

Incorrect Display of Custom Type Attributes in Documentation #487

frhandlee opened this issue Aug 3, 2023 · 5 comments

Comments

@frhandlee
Copy link

frhandlee commented Aug 3, 2023

I'm currently facing an issue with the react-docgen-typescript tool where it fails to correctly display the attributes of a custom type, such as Tag, in the generated documentation. Instead of showing the detailed structure of the type, it simply displays 'Tag'.

Steps to Reproduce:
1.Define a custom type like this:
type Tag = {
text: string,
value: number
};
2. Use this custom type in a component's props:
interface ButtonProps {
tag: Tag;
}
3. Set the parser:
const parser =docgen.withDefaultConfig({
savePropValueAsString: true,
shouldExtractLiteralValuesFromEnum: true
});

Expected Behavior:
The documentation generated by react-docgen-typescript should accurately display the structure of the custom type Tag, including its properties and their descriptions.

Actual Behavior:
The documentation incorrectly displays 'Tag' instead of providing detailed information about the Tag type.
{
defaultValue: null,
description: '',
name: 'tag',
parent: undefined,
declarations: [
{
fileName: 'emrn-ui/emrn-ui/components/ActionSheet/ActionSheetProps.ts',
name: 'TypeLiteral'
}
],
required: true,
type: { name: 'Tag' }
}

@97vack
Copy link

97vack commented Sep 11, 2023

Yes, I have encountered it too. Have you resolved it?

@frhandlee
Copy link
Author

Yes, I have encountered it too. Have you resolved it?

是的,改了源码

@97vack
Copy link

97vack commented Sep 11, 2023

是的,我也遇到过。你解决了吗?

是的,改了源码

长沙的,怎么改的大佬,那不是还要将源码copy下来去改他的

@frhandlee
Copy link
Author

是的,我也遇到过。你解决了吗?

是的,改了源码

长沙的,怎么改的大佬,那不是还要将源码copy下来去改他的

是的,改动有点麻烦 一时半会说不清,这个库感觉是没人维护了

@97vack
Copy link

97vack commented Sep 11, 2023

是的,但是没有更好的库了貌似, 还有更好的库推荐吗, 或者大佬能把你改动的地方给我看看吗

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

2 participants