react-docgen-typescript-loader
react-docgen-typescript-loader copied to clipboard
Importing component defined in index breaks the docgen
trafficstars
doesn't work :
index.tsx
import * as React from 'react';
export interface AProps {
name?: string;
}
const A: React.FunctionComponent<AProps> = ({name}) => {
return <p>{name}</p>;
};
A.displayName = 'A';
export {A};
a.story.mdx
import {Meta, Story, Preview, Props} from '@storybook/addon-docs/blocks';
import {A} from '.'; // <------------------
<Meta title="A" component={A} />
<Story name="Default">
<A name="pelo" />
</Story>
<Props of={A} />
works:
A.tsx
same as index.tsx above
a.story.tsx
import {A} from './A'; // <------------------
<Meta title="A" component={A} />
<Story name="Default">
<A name="pelo" />
</Story>
<Props of={A} />
It seems that component files named with hypen cannot be parsed too