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 9656441 commit ce6cf92Copy full SHA for ce6cf92
src/index.ts
@@ -69,7 +69,7 @@ function useResizeObserver<T>(
69
});
70
71
useEffect(() => {
72
- if (resizeObserverRef.current) {
+ if (!(ref?.current instanceof Element) || resizeObserverRef.current) {
73
return;
74
}
75
@@ -103,14 +103,10 @@ function useResizeObserver<T>(
103
104
105
106
- }, []);
+ });
107
108
109
- if (
110
- typeof ref !== "object" ||
111
- ref === null ||
112
- !(ref.current instanceof Element)
113
- ) {
+ if (!(ref?.current instanceof Element)) {
114
115
116
0 commit comments