DEV Community

Discussion on: Let's get to know the ResizeObserver 👋🏼

Collapse
 
cvanpoelje profile image
cvanpoelje

Listeners at root level will cost your app a lot more, especially when you use a lot of them. With the ability to apply them on children instead of root it must be easier to stop the Event listener from listening when the element no longer exists to prevent memory leaks.