Open ElForastero opened 4 years ago
The source of the issue in this comment in storybook repo.
I have repeated the steps from Storybook Docs Typescript Walkthrough.
Everything works fine, except for default exports. If there are no named exports, default exports don't work.
import React from 'react'; import Button from './Test'; export default { title: 'base/Button', component: Button, }; export const primary = () => <Button>Push me</Button>;
import React, { FC } from "react"; interface ButtonProps { /** * Simple click handler */ onClick?: () => void; } /** * The world's most _basic_ button */ const Button: FC<ButtonProps> = ({ children, onClick }) => ( <button onClick={onClick} type="button"> {children} </button> ); export default Button;
export
import React, { FC } from "react"; interface ButtonProps { /** * Simple click handler */ onClick?: () => void; } /** * The world's most _basic_ button */ export const Button: FC<ButtonProps> = ({ children, onClick }) => ( <button onClick={onClick} type="button"> {children} </button> ); export default Button;
The source of the issue in this comment in storybook repo.
I have repeated the steps from Storybook Docs Typescript Walkthrough.
Everything works fine, except for default exports. If there are no named exports, default exports don't work.
Story
Component.
This one doesn't work.
But this works fine
Note an
export
statement near the Button.Screenshots:
No named export
With named export