React <TextareaAutosize /> component

Component with maxRows and minRows

  <TextareaAutosize
    minRows={3}
    maxRows={6}
    defaultValue="Just a single line..."
    />

Component with maxRows and minRows (box-sizing: border-box)

  <TextareaAutosize
    style={{boxSizing: 'border-box'}}
    minRows={3}
    maxRows={6}
    defaultValue="Just a single line..."
    />

Component with maxRows

  <TextareaAutosize
    maxRows={5}
    defaultValue="Just a single line..."
    />

Component with rows set

  <TextareaAutosize
    rows={4}
    defaultValue="Just a single line..."
    />

Controlled mode

  <TextareaAutosize
    cacheMeasurements
    value={value}
    onChange={ev => setValue(ev.target.value)}
    />

Uncontrolled mode

  <TextareaAutosize
    defaultValue={new Array(15).join('
Line.')}
    />

Receive message on height change.

  <TextareaAutosize
    cacheMeasurements
    onHeightChange={(height) => console.log(height)}
    />

Multiple textareas updated at the same time.

This one controls the rest.
Those get controlled by the one above.