Skip to content

Commit ed57dae

Browse files
Fixes total number of loops
1 parent 888573a commit ed57dae

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/keyframes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ export default class Keyframes extends React.Component {
7474
requestNextFrame () {
7575
this.waitForDelay(() => {
7676
const frameNum = this.state.frameNum + 1;
77+
const loopNum = this.state.loopNum + 1;
7778
if (this.props.children.length <= frameNum) {
78-
if (this.props.loop === true || this.props.loop === 'infinite' || this.state.loopNum < this.props.loop) {
79+
if (this.props.loop === true || this.props.loop === 'infinite' || loopNum < this.props.loop) {
7980
this.setState({
8081
frameNum: 0,
81-
loopNum: this.state.loopNum + 1
82+
loopNum
8283
});
8384
this.requestNextFrame();
8485
return;

0 commit comments

Comments
 (0)