File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { action } from '@storybook/addon-actions' ;
21import { Meta , Story } from '@storybook/react' ;
32import { IntersectionOptions , InView , useInView } from '../index' ;
43import { motion } from 'framer-motion' ;
@@ -80,6 +79,7 @@ const story: Meta = {
8079 table : {
8180 disable : true ,
8281 } ,
82+ action : 'InView' ,
8383 } ,
8484 } ,
8585 args : {
@@ -96,10 +96,12 @@ const Template: Story<Props> = ({
9696 inlineRef,
9797 ...rest
9898} ) => {
99+ // const onChange: IntersectionOptions['onChange'] = (inView, entry) => {
100+ // action('InView')(inView, entry);
101+ // }
99102 const { options, error } = useValidateOptions ( rest ) ;
100- const { ref, inView, entry } = useInView ( ! error ? options : { } ) ;
103+ const { ref, inView } = useInView ( ! error ? { ... options } : { } ) ;
101104 const [ isLoading , setIsLoading ] = useState ( lazy ) ;
102- action ( 'InView' ) ( inView , entry ) ;
103105
104106 useEffect ( ( ) => {
105107 if ( isLoading ) setIsLoading ( false ) ;
You can’t perform that action at this time.
0 commit comments