From ed1b306c5fd4d2a913ee52f822b50cc7f52495fb Mon Sep 17 00:00:00 2001 From: Gerson Montenegro Date: Sat, 25 Aug 2018 00:50:27 +1200 Subject: [PATCH] Adding startAt prop to implement delay start. --- dist/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index c2b339f..4bdab03 100644 --- a/dist/index.js +++ b/dist/index.js @@ -89,7 +89,11 @@ export default class AnimateNumber extends Component { this.startFrom = this.state.value this.endWith = this.props.value this.dirty = true - this.startAnimate() + setTimeout( + () => { + this.startAnimate() + } + , this.props.startAt != null ? this.props.startAt : 0); } componentWillUpdate(nextProps, nextState) {