react-use/stories/useWindowSize.story.tsx
Anton Zinovyev 2832b7a37e
chore: move all stories from src directory. (#715)
chore: clean tsconfig.json;

feat: updated webpack config to export a function to achieve full-control mode, instead of deprecated Extend Mode;
2019-12-09 23:36:40 +03:00

20 lines
484 B
TypeScript

import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { useWindowSize } from '../src';
import ShowDocs from './util/ShowDocs';
const Demo = () => {
const { width, height } = useWindowSize();
return (
<div>
<div>width: {width}</div>
<div>height: {height}</div>
</div>
);
};
storiesOf('Sensors|useWindowSize', module)
.add('Docs', () => <ShowDocs md={require('../docs/useWindowSize.md')} />)
.add('Demo', () => <Demo />);