Skip to content

Commit

Permalink
Reset counter when duration changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkelov committed Jul 22, 2019
1 parent 9430928 commit 71ecde5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/CountUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CountUp extends Component {
this.props.duration !== prevProps.duration ||
this.props.start !== prevProps.start
) {
this.instance.reset();
this.instance = this.createInstance();
this.start();
}
Expand Down

0 comments on commit 71ecde5

Please sign in to comment.