react-animate-height
Advanced tools
Comparing version 3.0.0 to 3.0.1
123
CHANGELOG.md
# Changelog | ||
### v3.0.0 | ||
### v3.0.0, v3.0.1 | ||
01.06.2022. | ||
31.05.2022. | ||
**Changed** | ||
* Rewritten to hooks | ||
* Switched to TypeScript | ||
* Callback names changed | ||
* `onAnimationStart` -> `onHeightAnimationStart` | ||
* `onAnimationEnd` -> `onHeightAnimationEnd` | ||
- Rewritten to hooks | ||
- Switched to TypeScript | ||
- Callback names changed | ||
- `onAnimationStart` -> `onHeightAnimationStart` | ||
- `onAnimationEnd` -> `onHeightAnimationEnd` | ||
- Switched back to a short timeout instead of requestAnimationFrame for starting the animation | ||
----- | ||
--- | ||
@@ -23,5 +24,5 @@ ### v2.1.1, v2.1.2 | ||
* Added check for `prefers-reduced-motion` and disabled animations if it is set to `true` - [#124](https://github.com/Stanko/react-animate-height/issues/124) | ||
- Added check for `prefers-reduced-motion` and disabled animations if it is set to `true` - [#124](https://github.com/Stanko/react-animate-height/issues/124) | ||
----- | ||
--- | ||
@@ -34,5 +35,5 @@ ### v2.1.0 | ||
* Fixed component not working with React 18 and StrictMode - [#123](https://github.com/Stanko/react-animate-height/issues/123) | ||
- Fixed component not working with React 18 and StrictMode - [#123](https://github.com/Stanko/react-animate-height/issues/123) | ||
----- | ||
--- | ||
@@ -45,6 +46,6 @@ ### v2.0.23 | ||
* Added "id" and "aria-hidden" props. | ||
* Added section about accessibility in the readme. | ||
- Added "id" and "aria-hidden" props. | ||
- Added section about accessibility in the readme. | ||
----- | ||
--- | ||
@@ -57,5 +58,5 @@ ### v2.0.22 | ||
* Added "engines" to `package.json` - [#91](https://github.com/Stanko/react-animate-height/issues/91) | ||
- Added "engines" to `package.json` - [#91](https://github.com/Stanko/react-animate-height/issues/91) | ||
----- | ||
--- | ||
@@ -68,5 +69,5 @@ ### v2.0.21 | ||
* Updated the readme with the specific flex box usecase - [#89](https://github.com/Stanko/react-animate-height/issues/89) | ||
- Updated the readme with the specific flex box usecase - [#89](https://github.com/Stanko/react-animate-height/issues/89) | ||
----- | ||
--- | ||
@@ -79,5 +80,5 @@ ### v2.0.18, v2.0.19 and v2.0.20 | ||
* Fixed TS types - [#88](https://github.com/Stanko/react-animate-height/issues/88) | ||
- Fixed TS types - [#88](https://github.com/Stanko/react-animate-height/issues/88) | ||
----- | ||
--- | ||
@@ -90,5 +91,5 @@ ### v2.0.17 | ||
* Fixed TS types to include `HTMLAttributes<HTMLDivElement>` [#86](https://github.com/Stanko/react-animate-height/issues/86) | ||
- Fixed TS types to include `HTMLAttributes<HTMLDivElement>` [#86](https://github.com/Stanko/react-animate-height/issues/86) | ||
----- | ||
--- | ||
@@ -101,5 +102,5 @@ ### v2.0.16 | ||
* Request animation frame is now cleared on unmount | ||
- Request animation frame is now cleared on unmount | ||
----- | ||
--- | ||
@@ -112,5 +113,5 @@ ### v2.0.14-v2.0.15 | ||
* Reverted back changes, which led to a broken build. | ||
- Reverted back changes, which led to a broken build. | ||
----- | ||
--- | ||
@@ -123,5 +124,5 @@ ### v2.0.10-v2.0.13 | ||
* Package now works as a ESM module [#73](https://github.com/Stanko/react-animate-height/issues/73). | ||
- Package now works as a ESM module [#73](https://github.com/Stanko/react-animate-height/issues/73). | ||
----- | ||
--- | ||
@@ -134,5 +135,5 @@ ### v2.0.9 | ||
* Improved prop types for `height` prop. | ||
- Improved prop types for `height` prop. | ||
----- | ||
--- | ||
@@ -145,5 +146,5 @@ ### v2.0.8 | ||
* Fixed type definitions [#68](https://github.com/Stanko/react-animate-height/issues/68). | ||
- Fixed type definitions [#68](https://github.com/Stanko/react-animate-height/issues/68). | ||
----- | ||
--- | ||
@@ -156,5 +157,5 @@ ### v2.0.7 | ||
* Added param to `onAnimationStart` and `onAnimationEnd` callbacks, it is a object containing `newHeight` value in pixels. | ||
- Added param to `onAnimationStart` and `onAnimationEnd` callbacks, it is a object containing `newHeight` value in pixels. | ||
----- | ||
--- | ||
@@ -167,5 +168,5 @@ ### v2.0.6 | ||
* Removed `@types/react` from `optionalDependencies` [#62](https://github.com/Stanko/react-animate-height/issues/62). | ||
- Removed `@types/react` from `optionalDependencies` [#62](https://github.com/Stanko/react-animate-height/issues/62). | ||
----- | ||
--- | ||
@@ -178,5 +179,5 @@ ### v2.0.5 | ||
* Fixed [#61](https://github.com/Stanko/react-animate-height/issues/61) - omitted `onAnimationStart` and `onAnimationEnd` from being passed to the DOM element directly. | ||
- Fixed [#61](https://github.com/Stanko/react-animate-height/issues/61) - omitted `onAnimationStart` and `onAnimationEnd` from being passed to the DOM element directly. | ||
----- | ||
--- | ||
@@ -189,5 +190,5 @@ ### v2.0.4 | ||
* Added `isPercentage` helper function. | ||
- Added `isPercentage` helper function. | ||
----- | ||
--- | ||
@@ -200,6 +201,6 @@ ### v2.0.3 | ||
* Fixed small bug introduced with 2.0.0 - In `componentDidMount`, `this.state` was used instead of `prevState` | ||
* Content is not being hidden if set height is `auto` | ||
- Fixed small bug introduced with 2.0.0 - In `componentDidMount`, `this.state` was used instead of `prevState` | ||
- Content is not being hidden if set height is `auto` | ||
----- | ||
--- | ||
@@ -212,5 +213,5 @@ ### v2.0.2 | ||
* Fixed type script definitions file | ||
- Fixed type script definitions file | ||
----- | ||
--- | ||
@@ -223,5 +224,5 @@ ### v2.0.0 and v2.0.1 | ||
* Replaced `componentWillReceiveProps` by `componentDidUpdate` to address changes introduces with React v16.3 | ||
- Replaced `componentWillReceiveProps` by `componentDidUpdate` to address changes introduces with React v16.3 | ||
----- | ||
--- | ||
@@ -234,5 +235,5 @@ ### v1.0.4 | ||
* Enabled react v16.3+ in peer dependencies until react-animate-height v2 is out | ||
- Enabled react v16.3+ in peer dependencies until react-animate-height v2 is out | ||
----- | ||
--- | ||
@@ -245,6 +246,6 @@ ### v1.0.3 | ||
* Moved helpers outside of component to make component lighter | ||
* Updated few dependencies | ||
- Moved helpers outside of component to make component lighter | ||
- Updated few dependencies | ||
----- | ||
--- | ||
@@ -257,6 +258,6 @@ ### v1.0.2 | ||
* Added `delay` prop, kudos to @quagliero [#51](https://github.com/Stanko/react-animate-height/pull/51) | ||
* Changelog | ||
- Added `delay` prop, kudos to @quagliero [#51](https://github.com/Stanko/react-animate-height/pull/51) | ||
- Changelog | ||
----- | ||
--- | ||
@@ -269,5 +270,5 @@ ### v1.0.1 | ||
* `animateOpacity` prop was passed directly to the `div` element, omitted it | ||
- `animateOpacity` prop was passed directly to the `div` element, omitted it | ||
----- | ||
--- | ||
@@ -280,10 +281,10 @@ ### v1.0.0 | ||
* `animateOpacity` prop which fades content in or out depending on animation direction | ||
- `animateOpacity` prop which fades content in or out depending on animation direction | ||
**Changed** | ||
* Removed unused vendor prefixes for `translate` | ||
- Removed unused vendor prefixes for `translate` | ||
----- | ||
--- | ||
For changes prior version 1.0.0 please check the [commit list](https://github.com/Stanko/react-animate-height/commits/master). |
@@ -67,9 +67,7 @@ "use strict"; | ||
} | ||
// Start animation helper using nested requestAnimationFrames | ||
// Start animation helper to allow rendering of the initial animation state first | ||
function startAnimationHelper(callback) { | ||
requestAnimationFrame(() => { | ||
requestAnimationFrame(() => { | ||
callback(); | ||
}); | ||
}); | ||
setTimeout(() => { | ||
callback(); | ||
}, 50); | ||
} | ||
@@ -186,2 +184,3 @@ const ANIMATION_STATE_CLASSES = { | ||
// that change should be animated | ||
console.log('newHeight: ', newHeight); | ||
setCurrentHeight(newHeight); | ||
@@ -188,0 +187,0 @@ setOverflow('hidden'); |
@@ -28,9 +28,7 @@ import React, { useEffect, useRef, useState } from 'react'; | ||
} | ||
// Start animation helper using nested requestAnimationFrames | ||
// Start animation helper to allow rendering of the initial animation state first | ||
function startAnimationHelper(callback) { | ||
requestAnimationFrame(() => { | ||
requestAnimationFrame(() => { | ||
callback(); | ||
}); | ||
}); | ||
setTimeout(() => { | ||
callback(); | ||
}, 50); | ||
} | ||
@@ -149,2 +147,3 @@ const ANIMATION_STATE_CLASSES = { | ||
// that change should be animated | ||
console.log('newHeight: ', newHeight); | ||
setCurrentHeight(newHeight); | ||
@@ -151,0 +150,0 @@ setOverflow('hidden'); |
{ | ||
"name": "react-animate-height", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Lightweight React component for animating height using CSS transitions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41676
555