react-simple-animate
Advanced tools
Comparing version 3.5.1 to 3.5.2
@@ -240,3 +240,3 @@ import * as React from 'react'; | ||
React.useEffect(() => { | ||
if ((onCompleteTimeRef.current || complete) && isPlaying) { | ||
if ((onComplete || complete) && isPlaying) { | ||
onCompleteTimeRef.current = setTimeout(() => { | ||
@@ -247,6 +247,6 @@ if (onComplete) { | ||
if (complete) { | ||
setAnimate({ | ||
setAnimate((animate) => ({ | ||
...animate, | ||
style: complete, | ||
}); | ||
})); | ||
} | ||
@@ -256,3 +256,3 @@ }, secToMs(delay + duration)); | ||
return () => onCompleteTimeRef.current && clearTimeout(onCompleteTimeRef.current); | ||
}, [isPlaying]); | ||
}, [animate, complete, delay, duration, isPlaying, onComplete]); | ||
return { | ||
@@ -262,3 +262,3 @@ isPlaying, | ||
play: React.useCallback((isPlaying) => { | ||
setAnimate({ | ||
setAnimate((animate) => ({ | ||
...animate, | ||
@@ -270,4 +270,4 @@ style: { | ||
isPlaying, | ||
}); | ||
}, []), | ||
})); | ||
}, [end, start, transition]), | ||
}; | ||
@@ -274,0 +274,0 @@ } |
@@ -264,3 +264,3 @@ 'use strict'; | ||
React__namespace.useEffect(() => { | ||
if ((onCompleteTimeRef.current || complete) && isPlaying) { | ||
if ((onComplete || complete) && isPlaying) { | ||
onCompleteTimeRef.current = setTimeout(() => { | ||
@@ -271,6 +271,6 @@ if (onComplete) { | ||
if (complete) { | ||
setAnimate({ | ||
setAnimate((animate) => ({ | ||
...animate, | ||
style: complete, | ||
}); | ||
})); | ||
} | ||
@@ -280,3 +280,3 @@ }, secToMs(delay + duration)); | ||
return () => onCompleteTimeRef.current && clearTimeout(onCompleteTimeRef.current); | ||
}, [isPlaying]); | ||
}, [animate, complete, delay, duration, isPlaying, onComplete]); | ||
return { | ||
@@ -286,3 +286,3 @@ isPlaying, | ||
play: React__namespace.useCallback((isPlaying) => { | ||
setAnimate({ | ||
setAnimate((animate) => ({ | ||
...animate, | ||
@@ -294,4 +294,4 @@ style: { | ||
isPlaying, | ||
}); | ||
}, []), | ||
})); | ||
}, [end, start, transition]), | ||
}; | ||
@@ -298,0 +298,0 @@ } |
{ | ||
"name": "react-simple-animate", | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"description": "react simple animate", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
"@types/enzyme-adapter-react-16": "^1.0.6", | ||
"@types/jest": "^25.2.3", | ||
"@types/jest": "^26.0.1", | ||
"@types/react": "^16.9.35", | ||
@@ -41,0 +41,0 @@ "@types/react-test-renderer": "^16.9.2", |
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
57263
40
944