NigelOToole / direction-reveal

Detects the direction a user enters or leaves an element allowing you to reveal or hide content based on this direction.
http://nigelotoole.github.io/direction-reveal/
MIT License
524 stars 39 forks source link

Cannot get it working in Gatsby / React #12

Open exocode opened 4 years ago

exocode commented 4 years ago

I've created a CodeSandbox with the most minimum requirements: https://codesandbox.io/s/direction-reveal-demo-nvfc6?file=/src/pages/index.js

My primary issue is, that the CSS animations are not picked up. The regular styling does. I took the ready rendered CSS and not the SCSS

Can you help me please or point me to the problem?

Many thanks in advance

AnushreeDhar commented 2 years ago

Hi has this been solved?

exocode commented 2 years ago

As far I can remember, I added some code to check if I am on Server or client:

  const containers =
    typeof document !== "undefined" ? document.querySelectorAll(selector) : []
  let touchStart

Not sure if this was everything to do... 🤷🏻‍♂️