-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResizeObserver Behavior Fixes and Changes
Updated the useResizeObserver to use `target` instead of `getTarget`. Stopped using the "shared" ResizeObserver for additionl performance since it lead to memory leaks when components unmounted. For some reason, the `observer.unobserve` doesn't actually stop the handlers from being called if it happened during a React unmount phase? The only way I could prevent the memory leak warnings was to isolate the resize observer to each useEffect and use `observer.disconnect()` which stops *all** (1) observered targets. Using `observer.unobserve` would still cause the memory leak warnings. The downside to this is that it is less performant, but this was probably a pre-mature optimiziation anyways. WICG/resize-observer#59
- Loading branch information
Showing
6 changed files
with
63 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters