import { storiesOf } from '@storybook/react'; import * as React from 'react'; import { useHash, useMount } from '../src'; import ShowDocs from './util/ShowDocs'; const Demo = () => { const [hash, setHash] = useHash(); useMount(() => { setHash('#/path/to/page?userId=123'); }); return (
window.location.href:
{window.location.href}
Edit hash:
setHash(e.target.value)} />
); }; storiesOf('Sensors/useHash', module) .add('Docs', () => ) .add('Demo', () => );