Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

componentWillReceiveProps has been renamed + useNativeDriver #380

Open
CarmineRumma opened this issue Jan 9, 2023 · 1 comment
Open

Comments

@CarmineRumma
Copy link

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
Copy link

antgel commented Oct 19, 2023

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants