NextJS: Window returns undefined

6/04/2023

wchr

wachira

@__wchr

NextJS: Window returns undefined

If you have ever faced an issue where importing a library from npm that throws `window is undefined` in NextJS using the global object `window` that gives access to the browser window, you could have that in a `useEffect` and assign it to a ref