-
Notifications
You must be signed in to change notification settings - Fork 24.6k
NavigationExperimental is broken when native animations are used #11377
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
Comments
There were quite a few bugs with native animations on iOS that were fixed by c858420. Can you try 0.40 which includes this commit to see if that solves this issue? |
@janicduplessis I can confirm that the bug is unfortunately not fixed in 0.40. Also, trying to pop a card with a vertical animation results in an "attempting to run JS driven animation" error, but only if |
@janicduplessis Yes, this fixes the problem described in this issue! Thanks. :) However, the vertical pop animation of NavigationCardStack still gives me the "Attempting to run JS driven animation" error, but perhaps I should open a separate issue for that. |
Cool, I'll have a look at that other issue next week. |
I found the other issue, which is (partly) in my code: because |
You can use the private api |
@denisw FYI, you can turning on Native Animation manually by modify the source code or extend from NavigationCardStack, not only when disabled gestures |
I need to programmatically switch enableGestures and kept getting the "attempting to run js driven animation on animation node" error. Here's how I solved it.
|
Navigation Experimental has been deprecated in favor of the |
Description
NavigationExperimental
always renders the last card in a stack after completing the first transition, even if the last card wasn't the target. It only (and always) occurs ifenableGestures={false}
, which is required if you want to take advantage of native animations.Expected:
CardStack
with two cards, 0 and 1, starting on 1Actual:
CardStack
with two cards, 0 and 1, starting on 1Reproduction
RNPlay uses an old version of React Native, so it can't be used to reproduce this bug. The bug is visible by running the reduced case in this repository: https://github.com/bendman/rn-navigator-bug
Solution
A temporary fix for library consumers is to remove
enableGestures="false"
, thereby not taking advantage of native animation optimizations that were made available in this commit. This also prevents consumers from disabling gestures.That solution isn't great because it forces a fallback to JS animation, which is slower. A more permanent solution would be to fix the native animation to render the correct card after a transition.
A middle-ground solution would be to add a separate flag for
enableNativeAnimation={bool}
, allowing consumers to set:This would make it possible to disable gestures while still having a working navigator.
Additional Information
The text was updated successfully, but these errors were encountered: