use-smooth-scroll icon indicating copy to clipboard operation
use-smooth-scroll copied to clipboard

window is not defined on SSR

Open 0sama opened this issue 4 years ago • 1 comments

'useSmoothScroll' is trying to access the window object on server-side.

just importing the package in a component would result to this error, I tried to require and run it inside useEffect but obviously, it won’t work as it's a hook itself.

0sama avatar Jan 18 '21 09:01 0sama

Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.

Andarist avatar Jan 18 '21 11:01 Andarist