Storybook, React, and TypeScript

yarn add @storybook/react babel-core ts-loader @types/storybook__react @types/storybook__addon-options @types/storybook__addon-actions @types/storybook__addon-links --dev
yarn global add @storybook/cli
getstorybook
mv ./stories/index.js ./stories/index.tsx
import React from 'react'
import * as React from 'react'
import * as React from 'react';import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
type Foo = (props:FooProps) => JSX.Element
interface FooProps {
children?: any
}
const Foo:Foo = ({children}) => <div>{children}</div>
storiesOf('Welcome', module).add('to Storybook', () => <Foo children="Hello, World!" />)

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store