We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27100af commit 183c832Copy full SHA for 183c832
src/useOnResize.js
@@ -25,6 +25,7 @@ export default (ref: React.ElementRef<any>, onResize: () => void) => {
25
// Ensure the target exists and is in fact an event listener
26
// this fixes an issue where contentDocument.defaultView is not a real window object
27
// as can be the case when used with React portals
28
+ const target = getTarget();
29
const isListener =
30
target && typeof target.removeEventListener === 'function';
31
0 commit comments