Observe the size and position of an element with a ResizeObserver.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Resize the textarea to see its size change.
const useResizeObserver = <T extends HTMLElement = HTMLElement>(
options?: ResizeObserverOptions,
) => [RefObject<T | null>, UseResizeObserverRect]