mirror of
https://github.com/streamich/react-use.git
synced 2026-02-01 14:37:31 +00:00
Also reduce max line width to 100. And remove `lint:types` step for commit sequence, it bothers when committing incomplete (wip) changes.
21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
import { storiesOf } from '@storybook/react';
|
|
import * as React from 'react';
|
|
import { useScrollbarWidth } from '../src';
|
|
import ShowDocs from './util/ShowDocs';
|
|
|
|
const Demo = () => {
|
|
const sbw = useScrollbarWidth();
|
|
|
|
return (
|
|
<div>
|
|
{sbw === undefined
|
|
? `DOM is not ready yet, SBW detection delayed`
|
|
: `Browser's scrollbar width is ${sbw}px`}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
storiesOf('Sensors/useScrollbarWidth', module)
|
|
.add('Docs', () => <ShowDocs md={require('../docs/useScroll.md')} />)
|
|
.add('Demo', () => <Demo />);
|