File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ Triggering animations once they enter the viewport is also a perfect use case
8181for an IntersectionObserver.
8282
8383- Set ` triggerOnce ` , to only trigger the animation the first time.
84- - Set ` threshold ` , to control how much of the element should visible before
84+ - Set ` threshold ` , to control how much of the element should be visible before
8585 firing the event.
8686- Instead of ` threshold ` , you can use ` rootMargin ` to have a fixed amount be
87- visible before triggering. Use a negative margin value, like ` -100px 0 ` , to
87+ visible before triggering. Use a negative margin value, like ` -100px 0px ` , to
8888 have it go inwards. You can also use a percentage value, instead of pixels.
8989
9090``` jsx
@@ -94,7 +94,7 @@ import { useSpring, animated } from 'react-spring'
9494
9595const LazyAnimation = () => {
9696 const [ref , inView ] = useInView ({
97- rootMargin: ' -100px 0 ' ,
97+ rootMargin: ' -100px 0px ' ,
9898 })
9999 const props = useSpring ({ opacity: inView ? 1 : 0 })
100100
You can’t perform that action at this time.
0 commit comments