Closed einaralex closed 5 years ago
The propTypes section returns: "Unknown" Component No propTypes defined!
Example component:
import React, { SFC, memo } from 'react'; interface IProps { /** * This is the value */ value: string; } export const Text: SFC<IProps> = memo(({ value }) => { return <div>{value}</div>; }); export default Text;
Story:
import React from 'react'; import { storiesOf } from '@storybook/react'; import { withInfo } from '@storybook/addon-info'; import { Text } from '.'; storiesOf('Text', module).add('test component', withInfo({ inline: true })(() => <Text value="text" />));
I got it work by wrapping the component in the default export.
export default memo(Text)
The propTypes section returns: "Unknown" Component No propTypes defined!
Example component:
Story: