Skip to content

Commit

Permalink
add null check to resize observer disconnect call
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Oct 8, 2024
1 parent 01f01a8 commit c0cfa40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useResizeObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const useResizeObserver = (
RO.observe(ref.current)

return () => {
RO.disconnect()
RO?.disconnect()
RO = null
}
}, [ref, handleResize])
Expand Down

0 comments on commit c0cfa40

Please sign in to comment.