useResizeObserver
Detects changes in the size of an element
Demo
Usage
With a reference to an element, you can use the useResizeObserver
utility to detect changes in the
size of an element.
You can stop the resize observer at any point by calling the stop
method.