react-textarea1.0.4 • Public • Published
Most often you only need the textarea
onChangehandler. Just as often, you don't need
autoGrowis a very nice to have feature on a textarea. Coupled with
onChange(value: String [, event ]): Function- the
onChangehandler will be called with the textarea value, not the
eventobject as first argument. The
eventobject is the second arg to the callback function.
stopChangePropagation: Boolean- defaults to true. By default, the propagation of the change event will be stopped. All other evens will work as usual. Set this prop to
autoGrow: Boolean- defaults to true.
resize: Boolean|String- defaults to true - making the textarea resizable in both directions. Pass
Stringto change this behaviour.
maxHeight: Number|String- the max height the textarea can have.
$ npm run dev
and navigate to
See react-field for
<input /> replacement.
Thanks to @andreypopp and his initial implementation at https://github.com/andreypopp/react-textarea-autosize