/react-hook-resizable-element

React hook to resize an element based on content

Primary LanguageTypeScriptMIT LicenseMIT

react-hook-resizable-element

A React useEffect hook to allow resizing of elements based of some dependency.

Works with any HTMLElement that has the following attributes:

  • ele.scrollHeight (read)
  • ele.style.height (read/write)

I wrote it specifically for teaxtarea, and checked it on textarea and p elements.

Links

github

npm

Credits

template for typescript NPM

article in medium by Owen Herterich