Skip to content

Commit

Permalink
chore: remove redundant observe call on unmount
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hoxyq authored Feb 19, 2024
1 parent c65defe commit df589bd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/AutoSizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export class AutoSizer extends Component<Props, State> {
}

if (this._resizeObserver) {
this._resizeObserver.observe(this._parentNode);
this._resizeObserver.disconnect();
}
}
Expand Down

0 comments on commit df589bd

Please sign in to comment.