You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are there any existing issues or PRs that relate to this problem? If so, link them here.
What is the current behavior?
As reported by damntv on Discord, useEventListener currently does not check the event target is valid, which can cause an error if you are trying to target window, document, etc. during SSR.
Steps to Reproduce
useEventListener(window, "resize", () => {});
Throws an error when server side rendered because the window is not defined on the server.
What is the expected behavior?
@react-hookz/web should check to make sure the event target is valid, at least on server side, before trying to set the event.