diff --git a/.changeset/0-twenty-hotels-repair.md b/.changeset/0-twenty-hotels-repair.md deleted file mode 100644 index cd1088d7..00000000 --- a/.changeset/0-twenty-hotels-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -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](https://github.com/DefinitelyTyped/DefinitelyTyped). diff --git a/.changeset/1-fuzzy-pears-raise.md b/.changeset/1-fuzzy-pears-raise.md deleted file mode 100644 index eff90206..00000000 --- a/.changeset/1-fuzzy-pears-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -At the same time the package internals have been rewritten to use React's [hooks API](https://reactjs.org/docs/hooks-intro.html). This means that the peer dependency requirement for React version had to be changed to `^16.8.0`. diff --git a/.changeset/2-mighty-cobras-tell.md b/.changeset/2-mighty-cobras-tell.md deleted file mode 100644 index bc5832f9..00000000 --- a/.changeset/2-mighty-cobras-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -You can now use `ref` prop to get access to the underlaying `textarea` element as [`React.forwardRef`](https://reactjs.org/docs/react-api.html#reactforwardref) is being used now. The support for `innerRef` has been completely removed. diff --git a/.changeset/3-big-shoes-tap.md b/.changeset/3-big-shoes-tap.md deleted file mode 100644 index bdf9f4c6..00000000 --- a/.changeset/3-big-shoes-tap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -`useCacheForDOMMeasurements` prop has been renamed to `cacheMeasurements`. diff --git a/.changeset/4-warm-meals-confess.md b/.changeset/4-warm-meals-confess.md deleted file mode 100644 index 47ad43c3..00000000 --- a/.changeset/4-warm-meals-confess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -`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. diff --git a/.changeset/5-dirty-guests-bathe.md b/.changeset/5-dirty-guests-bathe.md deleted file mode 100644 index 3aebce42..00000000 --- a/.changeset/5-dirty-guests-bathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': major ---- - -Removed handling `props.style.maxHeight` and `props.style.minHeight` values. If you need to control those boundaries you should use `maxRows` and `minRows` props respectively. diff --git a/.changeset/plenty-camels-grow.md b/.changeset/plenty-camels-grow.md deleted file mode 100644 index 4e8a1894..00000000 --- a/.changeset/plenty-camels-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-textarea-autosize': minor ---- - -The height is being set now directly on the underlaying `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. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..33639d57 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# react-textarea-autosize + +## 8.0.0 +### Major Changes + +- 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](https://github.com/DefinitelyTyped/DefinitelyTyped). +- At the same time the package internals have been rewritten to use React's [hooks API](https://reactjs.org/docs/hooks-intro.html). This means that the peer dependency requirement for React version had to be changed to `^16.8.0`. +- You can now use `ref` prop to get access to the underlaying `textarea` element as [`React.forwardRef`](https://reactjs.org/docs/react-api.html#reactforwardref) 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. +- Removed handling `props.style.maxHeight` and `props.style.minHeight` values. If you need to control those boundaries you should use `maxRows` and `minRows` props respectively. + +### Minor Changes + +- The height is being set now directly on the underlaying `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. diff --git a/package.json b/package.json index c5c6a754..16688b61 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-textarea-autosize", "description": "textarea component for React which grows with content", - "version": "7.1.2", + "version": "8.0.0", "keywords": [ "autosize", "grow", @@ -18,9 +18,7 @@ "./dist/react-textarea-autosize.esm.js": "./dist/react-textarea-autosize.browser.esm.js" }, "sideEffects": false, - "files": [ - "dist" - ], + "files": ["dist"], "author": "Andrey Popp <8mayday@gmail.com> (httsps://andreypopp.com/)", "contributors": [ "Mateusz BurzyƄski (https://github.com/Andarist)"