diff --git a/CircleTransition.js b/CircleTransition.js index 5809419..885eaad 100644 --- a/CircleTransition.js +++ b/CircleTransition.js @@ -9,19 +9,24 @@ class CircleTransition extends Component { this.state = { scale: new Animated.Value(0), - color: '#ccc' + color: '#ccc', + startedAniation: false }; } start(color, callback) { this.setState({ - color: color + color: color, + startedAniation: true }, () => { this.animate(callback); }); } animate(callback) { + this.setState({ + startedAniation: false + }); Animated.timing(this.state.scale, { toValue: 4, duration: this.props.duration, @@ -87,4 +92,4 @@ CircleTransition.defaultProps = { easing: Easing.linear } -export default CircleTransition; \ No newline at end of file +export default CircleTransition;