Skip to content

Commit 32fe67b

Browse files
committed
fix rootMargin definition
1 parent 43ab993 commit 32fe67b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Step.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import useIntersectionObserver from './useIntersectionObserver';
33

44
const useRootMargin = offset => {
5-
return `${offset * 100}% 0px -${100 - offset * 100}% 0px`;
5+
return `-${offset * 100}% 0px -${100 - offset * 100}% 0px`;
66
}
77

88
const Step = props => {
@@ -56,7 +56,7 @@ const Step = props => {
5656
document.removeEventListener('scroll', handleScroll);
5757
};
5858
}
59-
}, [entry, rootMargin]);
59+
}, [entry]);
6060

6161
return React.cloneElement(React.Children.only(children), {
6262
'data-react-scrollama-id': scrollamaId,

0 commit comments

Comments
 (0)