File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { useParallax } from '../../src' ;
2+ import { ParallaxProps , useParallax } from '../../src' ;
33import { Element } from '../Element/Element' ;
44import { Container } from '../Container' ;
55import styles from '../Parallax/Parallax.module.css' ;
66
7- const Template = ( args ) => {
8- const props = Object . entries ( args ) . reduce ( ( acc : any , entry : any ) => {
9- acc [ entry [ 0 ] ] = entry [ 1 ] . split ( ',' ) ;
10- return acc ;
11- } , { } as any ) ;
12-
7+ function ElementWithHook ( props : ParallaxProps ) {
138 const { ref } = useParallax < HTMLDivElement > ( props ) ;
149
1510 return (
1611 < div className = { styles . parallax } ref = { ref } >
1712 < Element name = "A" />
1813 </ div >
1914 ) ;
15+ }
16+
17+ const Template = ( args ) => {
18+ const props = Object . entries ( args ) . reduce ( ( acc : any , entry : any ) => {
19+ acc [ entry [ 0 ] ] = entry [ 1 ] . split ( ',' ) ;
20+ return acc ;
21+ } , { } as any ) ;
22+ return < ElementWithHook { ...props } /> ;
2023} ;
2124
2225export const WithRotation = Template . bind ( { } ) ;
You can’t perform that action at this time.
0 commit comments