From df589bd9fb9abe34b051a1aa8f9fd01688bd8921 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Mon, 19 Feb 2024 11:34:19 +0000 Subject: [PATCH] chore: remove redundant observe call on unmount This looks like a typo, `unobserve` should be called instead. Since `disconnect` is called right after it, it doesn't really have any effect, so we can remove it. Reading https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect, `disconnect` should unobserve all observed elements. --- src/AutoSizer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AutoSizer.ts b/src/AutoSizer.ts index fbb539a..d477d91 100644 --- a/src/AutoSizer.ts +++ b/src/AutoSizer.ts @@ -81,7 +81,6 @@ export class AutoSizer extends Component { } if (this._resizeObserver) { - this._resizeObserver.observe(this._parentNode); this._resizeObserver.disconnect(); } }