-
Notifications
You must be signed in to change notification settings - Fork 493
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
RN 0.63 Button compatibility - useNativeDriver was not specified #1227
Comments
Not all animations can use native driver, so maybe we just need to force config.useNativeDriver to non-optional in typescript now. |
@deregtd that sounds like the right plan. -- I wish there was a cleaner API from react-native that would tell us if a particular Animation supports This feels like an API Wart from RN's side. |
API warts from react native are a significant portion of the reason ReactXP exists. :) |
But the Button is only animating opacity in // reactxp/src/native-common/Button.tsx
setOpacityTo(value: number, duration: number) {
Animated.timing(
this._opacityAnimatedValue!,
{
toValue: value,
duration: duration,
easing: Animated.Easing.InOut(),
+ useNativeDriver: true,
},
).start();
} |
Ah, I misunderstood the suggestion. That change is okay, since the code appears to only animate opacity specifically in the button. But also we need to change the config's type to be nonoptional now to find any other broken spots. |
@Frexuz -- I think we should do this. Do you want to submit a PR for it? |
@fbartho yep :) |
React Native now complains if
useNativeDriver
wasn't specified when animating.reactxp/src/native-common/Button.tsx
Lines 372 to 381 in 3382b02
reactxp/src/native-common/Animated.tsx
Lines 160 to 167 in 3382b02
I can PR, but not sure if it's safe to just add
useNativeDriver: true
?The text was updated successfully, but these errors were encountered: