mastermoo / react-native-action-button

customizable multi-action-button component for react-native
MIT License
2.52k stars 569 forks source link

componentWillReceiveProps has been renamed + useNativeDriver #380

Open CarmineRumma opened 1 year ago

CarmineRumma commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂 In order to solve the warnings as per issue's title, here is the diff that solved them:

diff --git a/node_modules/react-native-action-button/ActionButton.js b/node_modules/react-native-action-button/ActionButton.js
index b8306c2..9e3d453 100644
--- a/node_modules/react-native-action-button/ActionButton.js
+++ b/node_modules/react-native-action-button/ActionButton.js
@@ -39,7 +39,7 @@ export default class ActionButton extends Component {
     clearTimeout(this.timeout);
   }

-  componentWillReceiveProps(nextProps) {
+  componentDidUpdate(nextProps) {
     if (nextProps.resetToken !== this.state.resetToken) {
       if (nextProps.active === false && this.state.active === true) {
         if (this.props.onReset) this.props.onReset();
@@ -316,7 +316,7 @@ export default class ActionButton extends Component {
     if (this.state.active) return this.reset();

     if (animate) {
-      Animated.spring(this.anim, { toValue: 1 }).start();
+      Animated.spring(this.anim, { toValue: 1, useNativeDriver: false }).start();
     } else {
       this.anim.setValue(1);
     }
@@ -328,7 +328,7 @@ export default class ActionButton extends Component {
     if (this.props.onReset) this.props.onReset();

     if (animate) {
-      Animated.spring(this.anim, { toValue: 0 }).start();
+      Animated.spring(this.anim, { toValue: 0, useNativeDriver: false }).start();
     } else {
       this.anim.setValue(0);
     }
antgel commented 11 months ago

Unfortunately, even if you had raised a PR for this, the package appears to be unmaintained since 2020, and I can't see an obvious fork to move it forward. Thanks for sharing though. :)