useElementSize

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.

General

Resize the textarea to see its size change.

APIs

useElementSize

const useElementSize = <T extends HTMLElement = HTMLElement>() => {
  ref: RefObject<T | null>
  width: number
  height: number
}
Edit this page on GitHub