File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ export function useParallax<T extends HTMLElement>(props: ParallaxProps) {
2424 } ;
2525 newElement = controller ?. createElement ( options ) ;
2626 setElement ( newElement ) ;
27- } else if ( ref . current === null ) {
28- // if the ref is null, do nothing
29- return ;
3027 } else {
3128 throw new Error (
3229 'You must assign the ref returned by the useParallax() hook to an HTML Element.'
@@ -38,7 +35,7 @@ export function useParallax<T extends HTMLElement>(props: ParallaxProps) {
3835 controller ?. removeElementById ( newElement . id ) ;
3936 }
4037 } ;
41- } , [ ref . current ] ) ;
38+ } , [ ] ) ;
4239
4340 // update element
4441 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import styles from './Image.module.scss';
55export const Image = ( props ) => {
66 const parallaxController = useParallaxController ( ) ;
77 function handleLoad ( ) {
8- parallaxController ? .update ( ) ;
8+ parallaxController . update ( ) ;
99 }
1010 return (
1111 < div className = { styles . image } >
You can’t perform that action at this time.
0 commit comments