Skip to content

componentWillReceiveProps has been renamed + useNativeDriver #380

Open
@CarmineRumma

Description

@CarmineRumma

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);
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions