-
Notifications
You must be signed in to change notification settings - Fork 24.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
Navigation Experimental Transition Animations Freeze #10574
Comments
What comes to the issue itself, I have had couple cases where animation transition ends until it's fully finished. I don't have any reproduction steps and it's really rare, so for me it could be that HMR or something else is causing it. |
@anttimo i stumbled upon the same - it happenes as soon as an alert is triggered while transitioning. For example iOS asking for permissions. |
@zachrnolan @K-Leon have you turned on the native driver for your animations when this happens? |
@anttimo IOS with Default Settings - so no native animations as far as i know (still not merged i think). For Android i used the native flag coming from this repo: #10289 without running into any issues. Another interesting Fact is that everything works fine with an older version of navigation experimental. ( https://github.com/aksonov/react-native-experimental-navigation ) |
I'd be happy to investigate the issue you're seeing, but I need help reproducing it. NavigationTransitioner probably doesn't need to call
The problem with |
@ericvicenti i opened an issue for this #10598 |
@anttimo How do you turn on native driver for animations? @ericvicenti one of our views that is having the issue calls a redux action to get data from the server (promise) using Redux Loop. When you first go to this screen it never seems to freeze during the navigation transition, however, when you push route to the same screen again (with unique key) it seems to freeze almost every time. I'm thinking that there are the following cases:
|
@zachrnolan You can see a example how it's done in the NavigationCardStack if you are not using it https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js#L221. I have turned nativeDriver off for now because of #10174. |
We are experiencing the same problem, with and without the Native Animation. @zachrnolan Does state change in your component result in any animations? Perhaps using LayoutAnimation? I believe the freeze happens when two animations happens at once. To make this even more interesting, doing Remote Debugging without the Native Animation, the transition never freezes, instead I get the following warnings where normally the app would freeze: |
So #10606 maybe related. |
Two animations at once? Can you avoid doing that? If it is intentional, what would that look like? |
@omeid The state change does not result in any animations. I've been testing more on a physical device and the freezing is happening a lot less often. Seems to happen more frequently when using the simulator. It also seems to happen when you're deeper in a navigation stack. |
@ericnakagawa Say a "Notification Status" slides down as your CardStack is transitioning. Similar to #10598. @zachrnolan Hmmm. Do you use react-redux? What transitioner? CardStack? I am trying to figure out if we are facing the same issue. |
@omeid I'm using react-redux and NavigationCardStack. I still haven't been able to pinpoint exactly why it's freezing. |
The issue seems to be that when any Redux event occurs (which of course, includes routing) all the routes gets rerenderd. Wrapping my "pure components" with the following 'use strict'
import React, { Component } from 'react'
export function ActiveSceneGuard (Scene) {
return class extends Component {
shouldComponentUpdate (nextProps) {
return nextProps.scene.isActive
}
render () {
console.debug('rendering', this.props.scene.key)
return (
<Scene {...this.props} />
)
}
}
} hope this solves your problem too @zachrnolan! |
@omeid Thanks for this! Can you show how you implemented this mixin? |
@zachrnolan Sorry, I meant component instead of mixin. You just pass your component to Essentially, If you're not using |
I got the same issue when setting/changing the navigation props during transition. |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
Description
We are experiencing a race condition where we try to set the state while the navigational experimental transition animation is still finishing, which freezes the screen. We have no way of knowing when this animation is finished, so not sure how to fix this.
It seems like Navigation Experimental is not respecting InteractionManager.runAfterInteractions (we tried it and it still let us update the state while the animation was halfway through). Does Navigation Experimental initiate a createInteractionHandle on start and clearInteractionHandle on completion?
Is there a way to know when the animation completes?
Additional Information
The text was updated successfully, but these errors were encountered: