Snippets Collections
const textAreaResized = () => {
  const handler = (e) => {
    const target = e.currentTarget;
    target.style.height = "auto";
    target.style.height = `${target.scrollHeight}px`;
  };

  return <textarea onChange={handler} />;
};
star

Sun Jan 08 2023 20:31:43 GMT+0000 (Coordinated Universal Time) https://codesandbox.io/s/textarea-resize-27kwsd?file=/src/App.js:84-94

#javascript #react.js #input #resized

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension