jsonkao / react-scrollama

Simple scrollytelling with the IntersectionObserver in React.
https://jsonkao.github.io/react-scrollama
MIT License
388 stars 30 forks source link

Failed to construct 'IntersectionObserver' #74

Closed ran-codes closed 2 years ago

ran-codes commented 2 years ago

Example code throws this error:

SyntaxError: Failed to construct 'IntersectionObserver': rootMargin must be specified in pixels or percent.

robhawkes commented 2 years ago

You can resolve this by setting an offset:

<Scrollama offset={0.5}>
  ...
</Scrollama>
jsonkao commented 2 years ago

Thank you @rl627 for bringing this to our attention and @robhawkes for providing the answer. I'll change the documentation now!

selfie-0 GitHub Selfies