Skip to content

Commit

Permalink
don't use alert in story
Browse files Browse the repository at this point in the history
  • Loading branch information
jeetiss committed Jun 14, 2019
1 parent 3305f39 commit 8fb5895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/useClickAway.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useClickAway} from 'react-use';
const Demo = () => {
const ref = useRef(null);
useClickAway(ref, () => {
alert('OUTSIDE CLICKED');
console.log('OUTSIDE CLICKED');
});

return (
Expand Down
5 changes: 2 additions & 3 deletions src/__stories__/useClickAway.story.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { useRef } from 'react';
Expand All @@ -6,9 +7,7 @@ import ShowDocs from './util/ShowDocs';

const Demo = () => {
const ref = useRef(null);
useClickAway(ref, () => {
alert('OUTSIDE CLICKED');
});
useClickAway(ref, action('outside clicked'));

return (
<div
Expand Down

0 comments on commit 8fb5895

Please sign in to comment.