react-textarea-autosize
Advanced tools
Changelog
8.3.1
49d7d04
#305 Thanks @mxschmitt! - Moved internal 'resize'
listener to the layout effect since React 17 calls cleanups of regular effects asynchronously. This ensures that we don't ever try to access the already unmounted ref in our listener.Changelog
8.1.0
db872f0
Thanks @Andarist! - TextareaAutosizeProps
are now based on React.TextareaHTMLAttributes<HTMLTextAreaElement>
instead of JSX.IntrinsicElements['textarea']
. The latter one includes a type for ref
attribute and it being included as part of TextareaAutosizeProps
has caused problems when using TextareaAutosizeProps
to declare wrapper components. This is also more semantically correct as ref
shouldn't be a part of props
. It's rather accepted by a particular JSX element and in case of the react-textarea-autosize
this is the type of the exported component which is React.ForwardRefExoticComponent<TextareaAutosizeProps>
(a result of React.forwardRef
call).Changelog
8.0.0
^16.8.0
.ref
prop to get access to the underlaying textarea
element as React.forwardRef
is being used now. The support for innerRef
has been completely removed.useCacheForDOMMeasurements
prop has been renamed to cacheMeasurements
.onHeightChange
callback no longer receives the second argument. It was the component's instance (its this
), but as the component is now implemented using hooks there no longer is any instance that could be given to a consumer like that.props.style.maxHeight
and props.style.minHeight
values. If you need to control those boundaries you should use maxRows
and minRows
props respectively.textarea
element and not caused by updating internal state and this triggering React's rerender. This shouldn't make for any observable difference for consumers of this package.