NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3300 most downloaded on npm
textarea component for React which grows with content
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 1.1 years
Most releases are documented
notes for 46 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
104 releases · first in 2013
This lets tools like Wrangler and the Cloudflare Vite Plugin pick up the right version of the built module, preventing issues like .
#417 cbced4f Thanks @threepointone! - Added edge-light and workerd conditions to package.json manifest to better serve users using Vercel Edge and Cloudflare Workers.
This lets tools like Wrangler and the Cloudflare Vite Plugin pick up the right version of the built module, preventing issues like https://github.com/cloudflare/workers-sdk/issues/8723.
### Patch Changes - #414 `d12e6a5` Thanks @benjaminwaterlot! - Fixed a race condition leading to an error caused by textarea being unmounted before in
One column per quarter.
d12e6a5 Thanks @benjaminwaterlot! - Fixed a race condition leading to an error caused by textarea being unmounted before internal requestAnimationFrame's callback being fired### Patch Changes - #409 `8c47e31` Thanks @Andarist! - Fixed an issue with resize not happening after the containing form being reset
### Patch Changes - #400 `7d48e9e` Thanks @Yonom! - Add React 19 to the allowed peer dependency range.
### Patch Changes - #401 `4a34e1b` Thanks @olee! - Add missing wordSpacing and scrollbarGutter as properties that can impact sizing
### Patch Changes - #397 `bf3cad8` Thanks @Oyveloper! - Force display: block for the hidden textarea to prevent other styles from overriding it and th
bf3cad8 Thanks @Oyveloper! - Force display: block for the hidden textarea to prevent other styles from overriding it and thus breaking the resizing functionality### Patch Changes - #386 `b3dc597` Thanks @Andarist! - Distribute completely separate files for the worker condition to avoid bundlers from aliasing f
### Patch Changes - #381 `e16c24a` Thanks @Andarist! - Publish files that were previously missing for some conditions.
### Patch Changes - #377 `4087205` Thanks @Andarist! - The provided onChange will get forwarded again to the underlying on the server side.
### Minor Changes - #373 `05b014a` Thanks @Andarist! - Compatibility with node's ESM has been improved. import TextareaAutosize from 'react-textarea-a
#373 05b014a Thanks @Andarist! - Compatibility with node's ESM has been improved. import TextareaAutosize from 'react-textarea-autosize'; was always meant to provide you the default export of this package (the exported component) and now node should load it this way.
#373 05b014a Thanks @Andarist! - SSR environments should now be able to pick smaller bundles through package.json#exports.
#373 05b014a Thanks @Andarist! - This package no longer depends on process.env.NODE_ENV. To get dev-only warnings you have to configure your bundler/runtime to use the development condition.
d33b120 Thanks @ArnaudRinquin! - Add a guard against potentially missing documents.fonts### Patch Changes - #353 `19aead9` Thanks @knownasilya! - Workaround for Firefox scrollHeight bug affecting textarea's height on a dynamic toggle - #3
#353 19aead9 Thanks @knownasilya! - Workaround for Firefox scrollHeight bug affecting textarea's height on a dynamic toggle
#362 2301195 Thanks @ArnaudRinquin! - Support automatic resizing when a custom fonts ends up loading
Thanks to this, the package now includes a worker condition that can be utilized by properly configured bundlers when targeting worker-like environmen
#354 41d10b2 Thanks @Andarist! - exports field has been added to the package.json manifest.
Thanks to this, the package now includes a worker condition that can be utilized by properly configured bundlers when targeting worker-like environments. It fixes the issue with browser-specific files being prioritized by some bundlers when targeting workers.
### Patch Changes - #341 `9124bbf` Thanks @rebelliard! - Add React 18 to the allowed peer dependency range.
9124bbf Thanks @rebelliard! - Add React 18 to the allowed peer dependency range.`0d7ac21` #326 Thanks @karlingen! - Account for word-break property when calculating the height.
0d7ac21 #326 Thanks @karlingen! - Account for word-break property when calculating the height.
6336448 #327 Thanks @circlingthesun! - Fixed the tabindex attribute name that is set on the hidden textarea used for height calculations.
`3c71884` #311 Thanks @Andarist! - Changed TextareaAutosizeProps to a TS interface which fixes the problem of "resolved" being type alias being inline
`49d7d04` #305 Thanks @mxschmitt! - Moved internal 'resize' listener to the layout effect since React 17 calls cleanups of regular effects asynchronou
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.`a16a46d` #296 Thanks @RDIL! - Allow React 17 in the specified peer dependency range.
`a1fc99f` #284 Thanks @emmenko! - Added { rowHeight: number } as a second parameter to the onHeightChange callback. This is useful to construct custom
`b7c227a` #280 Thanks @emdotem! - Fixed a broken call to setProperty that has prevented the library to work correctly.
`722e10a` #278 Thanks @emdotem! - Set inline style's height property with the "important" priority.
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).
61ca826 Thanks @Andarist! - maxHeight and minHeight has 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.
`2307033` #266 Thanks @vlazh! - Fixed a regression with calculating too high height for textareas with box-sizing: border-box;.
2307033 #266 Thanks @vlazh! - Fixed a regression with calculating too high height for textareas with box-sizing: border-box;.
1d1bba2 #265 Thanks @SimenB! - Exported TextareaAutosizeProps type for convenience.
da960f4 Thanks @Andarist! - Fixed an issue with internal cache not being populated correctly when using cacheMeasurements prop.
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 fr
^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.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
size improvements - removing propTypes in production builds, some micro optimizations
propTypes in production builds, some micro optimizations"browser" field now with slightly lighter code for browsersvalueRowCount property on component's instance holding total row count (including those over maxRows)onChange being called with second argument - this of the component…versions and at the same time won't be using deprecated componentWillReceiveProps hook.
Moved height recalculation to componentDidUpdate hook - should behave the same for all compatible React versions and at the same time won't be using deprecated componentWillReceiveProps hook.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Bail out from calculating dimenions for detached nodes (fixes #173)
No actual changes, sort of a bug fix - documented way of requiring the package in CJS env was to require('react-textarea-autosize').default, but accid
No actual changes, sort of a bug fix - documented way of requiring the package in CJS env was to require('react-textarea-autosize').default, but accidentally it got broken way over half a year ago in 5.1.0 (28 July 2017). Since that version CJS envs could do require('react-textarea-autosize') (without additional .default).
Interop between those 2 module formats is tricky if we do not provide additional interop helpers (that were omitted in "broken" versions) when bundling. It caused some issues in mixed SSR / browser development, so it got fixed, but due to long-standing nature of this "bug" it got decided to release this as major version if by any chance somebody has relied on the broken behaviour.
Nothing published for this version
accounting for tab-size property during height calculations (thanks to @tmilloff)
tab-size property during height calculations (thanks to @tmilloff)we are binding requestAnimationFrame to window in development mode to mitigate IE11 quirk with eval source maps
requestAnimationFrame to window in development mode to mitigate IE11 quirk with eval source mapsallowed React 16 as peer dependency
include font-style attribute in height calculations (thanks to @wokr)
font-style attribute in height calculations (thanks to @wokr)Nothing published for this version
fixed caching DOM measurements when the feature is used
Nothing published for this version
fixed issue with requestAnimationFrame passing its argument (number) to the _resizeComponent and that being passed to setState as callback
requestAnimationFrame passing its argument (number) to the _resizeComponent and that being passed to setState as callbackfixed issue with getComputedStyle returning null in Firefox when used in frame with display:none; on it
getComputedStyle returning null in Firefox when used in frame with display:none; on itintroduced work around Firefox bug which runs resize listeners even when other JS is running at the same moment - causing competing rerenders (due to
setState calls in the listener) in React. More can be found here - facebook/react#6324dropped support for the valueLink prop which supported using `LinkedStateMixin` which is deprecated since React 15
BREAKING CHANGES
box-sizingvalue, selectionStart , selectionEnd setters/getters, focus and blur (accessible before through ref on the component). If you need access to those please use inputRef prop to get ref of the underlaying DOM node and use native methods on itvalueLink prop which supported using LinkedStateMixin which is deprecated since React 15rows prop alias, please use minRows instead (previously it was the same thing anyway)NEW IN THE RELEASE
this as second argument to the onHeightChange callbackrowCount property on the instance which is the reason why this is passed to onHeightChange - so the rowCount may be accessed, this is for now the only prop supported that you may access, please do not use any internal stuffuid as cache key - important when using useCacheForDOMMeasurements prop, providing id or name to the component is no longer required for the cache to workfixed SSR regression introduced in v4.3.2 by window/document checks
v4.3.2 by window/document checksaccounting for various border widths, measuring them independently rather than just geting border-width
border-width100px, IE11 would return 80pxreattaching hiddenTextarea (used for measurements) to the DOM in case it gets deattached some how (by external scripts such as turbolinks in example)
hiddenTextarea (used for measurements) to the DOM in case it gets deattached some how (by external scripts such as turbolinks in example)added possibility to pass initial height through props.style.height
height through props.style.heightonChange for uncontrolled inputsfixed cursor jumps caused for controlled inputs (culprit: doubled height calculations - pre and post change)
setState, now it's called only when some change happenedstyle.setProperty) instead of element.setAttribute('style', ...) to avoid CSP issues with unsafe-inlineadded es build, more suitable for es6 modules aware tools like rollup and webpack2
es build, more suitable for es6 modules aware tools like rollup and webpack2babel's loose modeinputRef being passed to the underlaying element which caused unused properties warningswitched to using PropTypes from external package (fixed React 15.5.0 deprecation warning)
PropTypes from external package (fixed React 15.5.0 deprecation warning)inputRef which gets passed as ref callback to the underlaying elementdecided not to support IE8 ever (previous status - PR welcomed)
Your coding agent can read these notes before it upgrades. Set up the MCP server →