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

useOrientation is not SSR safe #1570

Closed
edwinjoseph opened this issue Oct 13, 2020 · 1 comment · Fixed by #1870
Closed

useOrientation is not SSR safe #1570

edwinjoseph opened this issue Oct 13, 2020 · 1 comment · Fixed by #1870
Labels

Comments

@edwinjoseph
Copy link
Contributor

edwinjoseph commented Oct 13, 2020

What is the current behaviour?

When using useOrientation in an SSR app it causes the error window is undefined to be thrown.

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-use. Paste the link to your JSFiddle or CodeSandbox example below:

Use useOrientation in an SSR project

What is the expected behaviour?

If there isn't window object use some default values.

@streamich
Copy link
Owner

🎉 This issue has been resolved in version 17.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants