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

SSR support? #20

Closed
kahurangitama opened this issue Dec 2, 2018 · 2 comments
Closed

SSR support? #20

kahurangitama opened this issue Dec 2, 2018 · 2 comments

Comments

@kahurangitama
Copy link

Hi!
I'm trying to use wowjs in React app and everything was fine, until I moved the project to SSR.
Since on server we have no window object it says:

/client/node_modules/wowjs/dist/wow.js:336
      if ('requestAnimationFrame' in window) {
                                     ^

ReferenceError: window is not defined

Is there any possibility to review the lib and include SSR support?

@graingert
Copy link
Owner

graingert commented Dec 3, 2018

wow is deprecated in favour of aos, and when building a react application you should always look for modern libraries, and avoid legacy ones that predate React eg: https://github.com/researchgate/react-intersection-observer/blob/master/README.md

@graingert
Copy link
Owner

You can also conditionally import wow, based on process.browser

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

2 participants