Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 5a017da

Browse files
committed
Unobserving elements after unmount
1 parent 497616d commit 5a017da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class ResizeObserverComponent extends Component {
6262
}
6363

6464
componentWillUnmount() {
65-
if (this.element) {
66-
this.unobserve(this.element);
65+
if (this.ref.current) {
66+
this.unobserve(this.ref.current);
6767
}
6868
}
6969

0 commit comments

Comments
 (0)