-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Flickering in animation after updating react native #6037
Comments
Same issue with animating |
@ArsenSheripov Can I ask you to provide working repro? Unfortunately your example is not working, also there is nothing in the code that triggers animation. Hard to help without that |
@exploIF https://snack.expo.dev/kLsBpRavc-_8FcsALDcbE?platform=android |
@ArsenSheripov I've checked your repro on both Android and iOS and everything works fine on my end |
@exploIF The issue appears in my project in production mode only. Maybe that could help you? |
@exploIF |
I saw, after trying each version, that the flick in my case starts since Maybe one of these commits introduced the regression in some edge case Edit: I'm using this patch now react-native-reanimated+3.11.0.patch and the flick is gone The original 3.11.x patch #5960 (comment) + revert of 74985c3 |
downgrading doesn't work for me |
Thanks. Your patch fixed flickering on my side as well. I'm using JS variable (containerWidth) inside useAnimatedStyle's callback. It's = 0 by default and then it changes once to N. Without that patch, useAnimatedStyle's callback would get called several times and would jump between using previous/stale (0) value and current one (N) whenever there is re-render caused by parent component.
Passing containerWidth to deps array did not help. Had to revert from freshly released 3.12.0 back to 3.11.0 tho, because the issue's still happening with 3.12.0. |
Hey everyone, could you also try 3.12 version? It contains the aforementioned 3.11.x patch |
Hi @szydlovsky, I tested it out. Note A clean installation of 3.12.x triggers the property exception mentioned in #6082. I removed my patch and used the one attached to the issue for testing. The flickering issue remains in version 3.12. Digging into the commit I mention before, I found that in this function: react-native-reanimated/src/createAnimatedComponent/PropsFilter.tsx Lines 106 to 116 in 74985c3
shallowEquals always returns false when the style (using useAnimatedStyle ) property updates, causing a re-render each time, which results in the flickering.
|
hi, I tried version 3.12, the flickering is still there |
Finaly, we rewrote the animations where we changed the position to absolute, useEffect to useAnimatedReaction, and also removed withTiming() from useAnimatedStyle(), and the animation began to work smoothly again. Thanks to all. |
Hey @ArsenSheripov @pavelbabenko @exodusanto @kmarushchakItomy could you guys try this patch?: |
Great @szydlovsky! It's working on my end 🔝 |
## Summary Unfortunately, turns out the PR with dynamic styles #5268 introduced more problems than it solved. Thus, proposing a revert. This revert most likely fixed: - #6203 - #6102 - #6037 as well as one more not-published issue and potentially a few more. ## Notes Even if it gets approved, to be merged ONLY after @tjzel agrees with everything ## Test plan 😢 😭
The fix should be there by the next stable version (3.14.0 or next iteration of 3.13.x) |
Description
Hello everyone, I had a problem after updating react native to version 0.74.1; after the update, the header animation began to flicker heavily when activated.
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/@arsen.sheripov/upbeat-blue-waffle
Reanimated version
3.11.0
React Native version
0.74.1
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Release app & production bundle
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: