react-reveal
react-reveal copied to clipboard
Prevent animation on reload, or when scrolling in different direction?
This is probably related to the other issue:
Say your app fades in its elements (from bottom) as you scroll down. This is great. However, if the user reloads the page, then scrolls up, the elements will still fade in from the bottom, which looks very wonky. Is there a (clean) way to prevent this fade in after reload, or on scroll up?
Maybe you could add a when (https://www.react-reveal.com/docs/when/) prop to the component, and keep the direction of the scrolling on that prop with a eventListener:
window.addEventListener('scroll', this.handleScroll);
So if the user is scrolling down, set the prop as true.
Maybe you could add a
when(https://www.react-reveal.com/docs/when/) prop to the component, and keep the direction of the scrolling on that prop with a eventListener:window.addEventListener('scroll', this.handleScroll);So if the user is scrolling down, set the prop as
true.
Oh I somehow (stupidly) missed that bit of documentation. Thanks, I'll give it a try