db872f0Thanks @Andarist! -
TextareaAutosizePropsare now based on
JSX.IntrinsicElements['textarea']. The latter one includes a type for
refattribute and it being included as part of
TextareaAutosizePropshas caused problems when using
TextareaAutosizePropsto declare wrapper components. This is also more semantically correct as
refshouldn't be a part of
props. It's rather accepted by a particular JSX element and in case of the
react-textarea-autosizethis is the type of the exported component which is
React.ForwardRefExoticComponent<TextareaAutosizeProps>(a result of
61ca826Thanks @Andarist! -
minHeighthas been disallowed as part of
TextareaAutosizeProps['style']. The intention to do that was there since the v8 release but it was not implemented correctly and allowed those to slip into the mentioned type.
- 📦 The package has been rewritten in TypeScript so type definitions are now included in the package itself. There is no need to install separate types from the DefinitelyTyped.
- 📦 At the same time the package internals have been rewritten to use React's hooks API. This means that the peer dependency requirement for React version had to be changed to
- 🚚 You can now use
refprop to get access to the underlaying
React.forwardRefis being used now. The support for
innerRefhas been completely removed.
useCacheForDOMMeasurementsprop has been renamed to
onHeightChangecallback 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.
- ✂ Removed handling
props.style.minHeightvalues. If you need to control those boundaries you should use
- ⚡️ The height is being set now directly on the underlaying
textareaelement 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.
v7.1.2October 30, 2019