⨯ ReferenceError: window is not defined
GET /page 500
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:
The rabbit hole is deeper than I imagined it'd be. Seems like useEffect would be the right approach to solve this issue with Next.js, but it would completely change the way this works on React only apps.
What is the current behavior?
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:https://codesandbox.io/p/devbox/strange-dawn-ngvwfs
What is the expected behavior? window to be accessed in the client side.
A little about versions:
react-use
: 17.5.1