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

Interaction observer does not work correctly when added to multiple pages #60

Open
pfortes opened this issue Nov 2, 2019 · 0 comments

Comments

@pfortes
Copy link

pfortes commented Nov 2, 2019

The interaction observer component stops working if it exists in two different pages and you navigate directly from one to the other.

i created a test in codesandbox that adds the IO-Example component to the about page, there you can see that if you refresh any of the pages it works but if you navigate from one to the other the interaction is not registered.

https://codesandbox.io/s/gatsby-universal-smyvs

Edit: I ended up using the useInView hook from https://github.com/thebuilder/react-intersection-observer and it works great.

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