import { useRef } from 'react';
import { Meta, DocsContainer, Story } from '@storybook/addon-docs';

<Meta title="Addons/Docs/ref" />

## Passing React ref

<Story name="ref">
  {() => {
    const ref = useRef(null);
    return (
      <>
        <div ref={ref} style={{ overflow: 'hidden' }} />
        <button onClick={() => console.log(ref.current)}>Log ref value</button>
      </>
    );
  }}
</Story>
