From ac0bdadc389a9a494c3df7fb68ef0163aeb32f84 Mon Sep 17 00:00:00 2001 From: Vasil Dimitrov Date: Sun, 5 Sep 2021 15:22:36 +0200 Subject: [PATCH] fix: upgrade use-elapsed-time to fix an issue with reset --- CHANGELOG.md | 8 +++++++- package.json | 4 ++-- src/types.ts | 9 +++------ yarn.lock | 8 ++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e188cc4..00be86e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log -## 3.0.0 ( ---- , 2021) +## 3.0.1 (September 5th, 2021) + +**Fix:** + +- upgraded `use-elapsed-time` to 3.0.2, which fixes an issue where reset method was taking any kind of value as newStartAt value. Not it checks if the value provided is a number + +## 3.0.0 ( September 5th , 2021) **Breaking Changes:** diff --git a/package.json b/package.json index be822c4..87b0d9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "use-count-up", - "version": "3.0.0", + "version": "3.0.1", "description": "React/React Native component and hook to animate counting up or down to a number", "main": "./lib/index.js", "module": "./lib/index.module.js", @@ -51,7 +51,7 @@ }, "homepage": "https://github.com/vydimitrov/use-count-up#readme", "dependencies": { - "use-elapsed-time": "3.0.1" + "use-elapsed-time": "3.0.2" }, "peerDependencies": { "react": ">=16.8.0" diff --git a/src/types.ts b/src/types.ts index cfcbfee..3a19e2d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,4 @@ -import { - ReturnValue as ETReturnValue, - Props as ETProps, -} from 'use-elapsed-time' +import { Props as ETProps } from 'use-elapsed-time' export type ReturnValue = number | string | React.ReactNode @@ -17,7 +14,7 @@ export interface ReturnProps { /** Current value of the count up animation */ value: ReturnValue /** Method to start over the animation*/ - reset: ETReturnValue['reset'] + reset: () => void } export interface Props { @@ -42,7 +39,7 @@ export interface Props { /** Function that formats the output value */ formatter?: (value: number) => ReturnValue /** Update interval in seconds. Determines how often the animated value will change. When set to 0 the value will update on each key frame. Default: 0 */ - updateInterval?: ETProps['updateInterval'] + updateInterval?: number /** On value update event handler. It receives the current value */ onUpdate?: (value: ReturnValue) => void } diff --git a/yarn.lock b/yarn.lock index d06fbf4..97eab02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2988,10 +2988,10 @@ urlgrey@1.0.0: dependencies: fast-url-parser "^1.1.3" -use-elapsed-time@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/use-elapsed-time/-/use-elapsed-time-3.0.1.tgz#43e562d711a1779580bb7548e14619c4dcfacfa1" - integrity sha512-Z83sKnBukVIgKYQFP1xgXgL5m9OPAkJ3bw2U9ghdemsdR3Z1Ju0Mco7SPVbgcNIJ2VJgZB/nurFouDOCC4P7Ag== +use-elapsed-time@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/use-elapsed-time/-/use-elapsed-time-3.0.2.tgz#ef22bf520e60f9873fd102925a2d5cbc5d4faaf5" + integrity sha512-2EY9lJ5DWbAvT8wWiEp6Ztnl46DjXz2j78uhWbXaz/bg3OfpbgVucCAlcN8Bih6hTJfFTdVYX9L6ySMn5py/wQ== uuid@^8.0.0: version "8.3.2"