-
Notifications
You must be signed in to change notification settings - Fork 569
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Animated: useNativeDriver
was not specified" warning since React Native 0.62
#339
"Animated: useNativeDriver
was not specified" warning since React Native 0.62
#339
Comments
I think the solution to the problem will be to implement the following change to the ActionButton.js file;
|
I have the same issue! |
1 similar comment
I have the same issue! |
This works. |
I am also facing the same issue. Manual change works but this warning will always occur every time when the application is rebuilt ( i.e. node_modules are installed again ). Same issue will occur when publishing the app. Is there any way we can suppress the warning till the author fixes this issue? |
I forwarded a message to the author requesting the error correction merge so that this error no longer appears. Now it's time to wait, as they take too long to make changes. |
It's working fine !! But the author should consider implementing these changes in the new version. |
there's a pull request to fix this since April, I hope the author is all okay and could merge it for the fix. |
Until the PRs get merged, monkey patching the class works, Hope this helps to some people annoyed by that warning import RNActionButton from 'react-native-action-button'
import { Animated } from 'react-native'
RNActionButton.prototype.animateButton = function(animate = true) {
if (this.state.active) return this.reset();
if (animate) {
Animated.spring(this.anim, { toValue: 1, useNativeDriver: false }).start();
} else {
this.anim.setValue(1);
}
this.setState({ active: true, resetToken: this.state.resetToken });
}
RNActionButton.prototype.reset = function (animate = true) {
if (this.props.onReset) this.props.onReset();
if (animate) {
Animated.spring(this.anim, { toValue: 0, useNativeDriver: false }).start();
} else {
this.anim.setValue(0);
}
setTimeout(() => {
if (this.mounted) {
this.setState({ active: false, resetToken: this.state.resetToken });
}
}, 250);
} |
How is this "monkey patch" used? |
You paste the code at the top of the file for the component where you're using the action button |
As @ChronSyn mentioned, you just paste the patch in any file. But since, it sets the prototype for a class, it's better to put it in an separate file as module an load it in some top level component like App so that it gets loaded only once(not that it makes much difference, but it feels better this way to load it). You don't need to put this patch in every file. Also do add a |
I am trying to use this in Typescript but the monkey patch doesn't seem to be working. Any fix that can help in typescript? @mannyhappenings @manishsharma004 @ChronSyn Errors being:
|
@ConstantTime Here are some quick and dirty typings:
|
The workaround: disable the warning:
|
Tip: Do this for any fix in any package you need to fix inside node_modules folder |
@GustavoContreiras-Feegow Thanks for the info. Any reason you are not using patch-package? |
https://www.npmjs.com/package/react-native-action-button-warnings-fixed Feel free to try it and create issues there, maybe we will be able to keep it maintained by community, in absence of creator |
I create a new component: import ActionButton from 'react-native-circular-action-menu';
reset() {
} this work to me |
Following warning keeps appearing whenever I click on any button or item:
Animated:
useNativeDriver
was not specified. This is a required option and must be explicitly set totrue
orfalse
react-native: 0.62
The text was updated successfully, but these errors were encountered: