react-timing-hooks
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.2.3](https://github.com/EricLambrecht/react-timing-hooks/compare/v2.2.2...v2.2.3) (2022-02-19) | ||
### Bug Fixes | ||
* Fix infinite render loop in paused useAnimationFrameLoop ([bda5715](https://github.com/EricLambrecht/react-timing-hooks/commit/bda5715668c8cc880eccc9a56b6b68d99bfc9cf8)), closes [#25](https://github.com/EricLambrecht/react-timing-hooks/issues/25) | ||
### [2.2.2](https://github.com/EricLambrecht/react-timing-hooks/compare/v2.2.1...v2.2.2) (2022-01-22) | ||
@@ -7,0 +14,0 @@ |
@@ -159,9 +159,11 @@ import { useRef, useCallback, useEffect, useState } from 'react'; | ||
rafCallback.current(); | ||
runInLoop(); | ||
} | ||
runInLoop(); | ||
}, []); | ||
const runInLoop = useAnimationFrame(nextCallback); | ||
useEffect(() => { | ||
runInLoop(); | ||
}, [runInLoop]); | ||
if (!pause) { | ||
runInLoop(); | ||
} | ||
}, [runInLoop, pause]); | ||
}; | ||
@@ -168,0 +170,0 @@ |
@@ -163,9 +163,11 @@ 'use strict'; | ||
rafCallback.current(); | ||
runInLoop(); | ||
} | ||
runInLoop(); | ||
}, []); | ||
const runInLoop = useAnimationFrame(nextCallback); | ||
react.useEffect(() => { | ||
runInLoop(); | ||
}, [runInLoop]); | ||
if (!pause) { | ||
runInLoop(); | ||
} | ||
}, [runInLoop, pause]); | ||
}; | ||
@@ -172,0 +174,0 @@ |
{ | ||
"name": "react-timing-hooks", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "React hooks for setTimeout, setInterval, requestAnimationFrame, requestIdleCallback", | ||
@@ -46,5 +46,6 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@shopify/jest-dom-mocks": "^2.9.1", | ||
"@testing-library/react": "^11.0.4", | ||
"@testing-library/react-hooks": "^3.4.1", | ||
"@shopify/jest-dom-mocks": "^3.0.13", | ||
"@testing-library/react": "^12.1.3", | ||
"@testing-library/react-hooks": "^4.0.1", | ||
"@testing-library/user-event": "^14.0.0-beta", | ||
"@types/jest": "^26.0.14", | ||
@@ -57,4 +58,4 @@ "@types/node": "^13.13.21", | ||
"emoji-cz": "^0.3.1", | ||
"jest": "^26.4.2", | ||
"node-fetch": "^2.6.1", | ||
"jest": "^27.5.1", | ||
"node-fetch": "^2.6.7", | ||
"prettier": "^2.1.2", | ||
@@ -69,3 +70,3 @@ "react": "^17.0.2", | ||
"standard-version": "^9.0.0", | ||
"ts-jest": "^26.4.0", | ||
"ts-jest": "^27.1.3", | ||
"typescript": "^4.0.3" | ||
@@ -72,0 +73,0 @@ }, |
@@ -0,0 +0,0 @@ [![npm](https://flat.badgen.net/npm/v/react-timing-hooks)](https://www.npmjs.com/package/react-timing-hooks) |
Sorry, the diff of this file is not supported yet
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
38633
463
24