@bithero/react-autoresize-textarea
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-autoresize-textarea

React component for an autoresizing textarea

License

This project is licensed under AGPL-3.0. See the LICENSE file for more informations.

Usage

Simply use the component as you would <textarea></textarea>.

import React, { useState, useRef } from 'react';
import { AutoresizeTextarea } from '@bithero/react-autoresize-textarea';

const MyComponent = () => {
    const [value, setValue] = useState();
    const ref = useRef<HTMLTextAreaElement>(null);    // you still can get an reference to the underlaying textarea
    return (<div>
        <label>Description</label>
        <AutoresizeTextarea ref={ref} onInput={(e) => setValue(e.target.value)} value={value}/>
    </div>);
}

Package Sidebar

Install

npm i @bithero/react-autoresize-textarea

Weekly Downloads

1

Version

1.0.1

License

AGPL-3.0-or-later

Unpacked Size

37.8 kB

Total Files

9

Last publish

Collaborators

  • mai-lapyst