From 5dc4627947391c3d84fd41847312705faa2a8bd2 Mon Sep 17 00:00:00 2001 From: rajpootathar Date: Mon, 5 Oct 2020 16:32:03 +0500 Subject: [PATCH] fixed crash if onFillChange is not provided onFillChange is not required by default. --- src/AnimatedCircularProgress.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/AnimatedCircularProgress.js b/src/AnimatedCircularProgress.js index b419b63..1331d31 100644 --- a/src/AnimatedCircularProgress.js +++ b/src/AnimatedCircularProgress.js @@ -10,10 +10,11 @@ export default class AnimatedCircularProgress extends React.PureComponent { this.state = { fillAnimation: new Animated.Value(props.prefill), }; - - this.state.fillAnimation.addListener(({ value }) => - props.onFillChange(value) - ); + if(props.onFillChange){ + this.state.fillAnimation.addListener(({ value }) => + props.onFillChange(value) + ); + } } componentDidMount() {