Get the width and height of an element and keep them updated.
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 useElementSize = <T extends HTMLElement = HTMLElement>() => {
ref: RefObject<T | null>
width: number
height: number
}