Closed danieldelcore closed 3 years ago
Confirming this is an issue, and a priority to fix.
For:
<Props
props={require('!!extract-react-types-loader!../src/my-component')}
/>
/src/my-component Works:
import React from 'react';
interface Props {
title: string;
}
export default ({
title,
}: Props) => (
<p>Hello</p>
)
Does not work, but should:
interface Props {
title: string;
}
const EmptyState: React.FC<Props> = ({
title,
}) => (
<p>Hello</p>
);
export default EmptyState;
This can be worked around for the time being, by adding an additional file:
./src/my-component/index.tsx
#export interface Props {
title: string;
}
const EmptyState: React.FC<Props> = ({
title,
}) => (
<p>Hello</p>
);
export default EmptyState;
👇 ./src/my-component/_atlaskit-docs-props.tsx
import { Props } from './my-component';
export default (arg: Props) => null
And importing this file instead, ie
<Props
props={require('!!extract-react-types-loader!../src/my-component/_atlaskit-docs-props')}
/>
Components typed using FC from
@types/react
should be supported.