-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
[Android]horizontal-stack animation with new architecture Enabled cause "Loss of precision during arithmetic conversion: (long) XX.X #754
Comments
Hey @nazacity, I'm here to assist you with any bugs, questions, or becoming a contributor. Let's squash those bugs together! 🤖 I found a similar issue that was resolved. The "Loss of precision during arithmetic conversion" error in a horizontal-stack animation with the new architecture enabled in React Native version 0.76.5 can be fixed by modifying the zIndex calculation in const zIndex = Math.round(interpolate(value, [-1, 0, 1], [0, size, 0])); This fix addresses the issue across iOS, Android, and Expo platforms with the specified versions [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Can you pls patch this with the soluction that dosubot gave, it works. But when building for store we cant do this. Thx for your work |
same thing is happening with parallax, and the fix is the same. |
Hello, i am also encountering this issue. Can we get a fix about this? thanks |
Here it the patch-package for {
"react-native-reanimated-carousel": "^4.0.0-canary.22",
} File: diff --git a/node_modules/react-native-reanimated-carousel/src/layouts/stack.ts b/node_modules/react-native-reanimated-carousel/src/layouts/stack.ts
index c8f8e06..9f64f70 100644
--- a/node_modules/react-native-reanimated-carousel/src/layouts/stack.ts
+++ b/node_modules/react-native-reanimated-carousel/src/layouts/stack.ts
@@ -301,7 +301,7 @@ function getCommonStyles(opts: {
}
return {
- zIndex,
+ zIndex: Math.round(zIndex),
opacity,
};
}
|
After upgrading to 0.76.5 enabled new arch
I also got Loss of precision during arithmetic conversio error too
I found out that zIndex function here cause the problem.
I replaced it with constants number it works fine I mean it can be slided.
The text was updated successfully, but these errors were encountered: