mirror of
https://github.com/streamich/react-use.git
synced 2026-02-01 14:37:31 +00:00
chore: clean tsconfig.json; feat: updated webpack config to export a function to achieve full-control mode, instead of deprecated Extend Mode;
19 lines
528 B
TypeScript
19 lines
528 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 />);
|