fixed crash if onFillChange is not provided

onFillChange is not required by default.
This commit is contained in:
rajpootathar 2020-10-05 16:32:03 +05:00 committed by GitHub
parent cef865aa16
commit 5dc4627947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {