Open ghost opened 6 years ago
Hi,
Is this some kind of automated test? I'm guessing it's something to do with running in something other than a real browser.
The error seems to come from accessing this.node.clientHeight
. Interestingly you're also getting the warning from here, which means that either window
is set to something falsy (but not undefined
as we check for that) or window.addEventListener
is something falsy.
We might be able to catch this by checking if window is falsy in line 9 rather than just checking for undefined.
Would you be able to edit the file "node_modules/react-animate-on-scroll/dist/scrollAnimation.min.js" at line 36, changing:
this.serverSide = typeof window === "undefined";
for
this.serverSide = !window;
and try running your test again?
Hello @dbramwell , Thank you for the response. And sorry for the delay. It worked as stated, both in the test environment and the actual environment
In development and/or production,
ScrollAnimation
works as expected, however, when I was running a component test on a component that containedScrollAnimation
, I got an errorThis is the content (summarized) of the
Hero.jsx
fileCan anyone help out on how to resolve this error