react-native-action-button
react-native-action-button copied to clipboard
When component re-render, the app is giving a warning
I want to solve this warning. When my component re-render, the app is giving a warning. @mastermoo Warning :
** ExceptionsManager.js:73 Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.
Please check the code for the ActionButton component. **
Code: //ActionButton.js line: 314
reset(animate = true) {
if (this.props.onReset) this.props.onReset();
if (animate) {
Animated.spring(this.anim, { toValue: 0 }).start();
} else {
this.anim.setValue(0);
}
setTimeout(
() => this.setState({ active: false, resetToken: this.state.resetToken }),
250
);
}