jaredLunde/react-hook

@react-hook/resize-observer@2.0.0 does not work in SSR

Closed this issue · 1 comments

Describe the bug
When using @react-hook/resize-observer without polyfill in SSR, the server rendering will fail as the default polyfill is refering to window.ResizeObserver

To Reproduce
Steps to reproduce the behavior:

  1. Create base NextJS app (with pages routing)
  2. Install @react-hook/resize-observer@2.0.0
  3. Use it in the SSR page.

Expected behavior
The SSR part is not crushing during the build or the docs should mention that package can no longer be used with SSR without polyfill.

Yeah, this is obviously the case. It's your responsibility to polyfill if you need it.