This is a simple example that shows how you can hook into the
ResizeObserver to watch and display
width of a single element. The component below will randomly change
max-width values to show live updates. You can also manually resize the browser
to see how outside changes can also affect the size.
By default, the
ResizeObserver will not listen to any resize events. You will need to enable
watchWidth for the
onResize callback to be called.