Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollReveal doesn't work with react-snap on first load, but after navigating with react-router to any page and come back again, is starts working on the same page #564

Open
burakkbilginn opened this issue Nov 2, 2023 · 0 comments

Comments

@burakkbilginn
Copy link

burakkbilginn commented Nov 2, 2023

As stated on the title, ScrollReveal doesn't work with react-snap on first load, but after navigating (with react-router) to any page and come again, is starts working on the same page. The code is like this:

var slideFromBottom = {
   distance: "40%",
   origin: "bottom",
   opacity: 0,
   duration: 1000,
   easing: "ease-out",
   reset: true,
   mobile: true,
 }
 useEffect(()=>{
     setTimeout(() => ScrollReveal().delegate(), 250)
     ScrollReveal().reveal(".modalContainer", slideFromBottom)
  },[])

Should I use a different library? Or maybe is there a way to handle this problem occuring with react-snap library(creating static html)?

Environment

  • Operating System: Windows 10 Pro
  • Browser Version:
  • ScrollReveal Version: 4.0.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant