React-native-navigation: [V2] Does the animation API actually work? Seems to never trigger an animation

Created on 26 Jul 2018  路  8Comments  路  Source: wix/react-native-navigation

Issue Description

When I try to set a simple fade animation (alpha from: 0, to: 1) on setRoot() it never actually happens.

Steps to Reproduce / Code Snippets / Screenshots

In your Navigation.events().registerAppLaunchedListener declare your animations as it describes in the documentation (With Navigation.setDefaultOptions()). Nothing is animated even though the documentation clearly states this is how you handle Navigation event animations.


Environment

  • React Native Navigation version: 2.0.2431
  • React Native version: 0.56.0
  • Platform(s) (iOS, Android, or both?): IOS (havnt tested on android)
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator & Device, IOS 10.2, Debug and Release build
馃彋 stale

Most helpful comment

I'm also trying to figure out how to animate on a setRoot call. The docs for animation suggest that it's only applied on push or showModal, but I'm really hoping that's not the case...

All 8 comments

It works for me if I pass the animation options during the navigation action like so:

 Navigation.push(this.props.componentId, {
    component: {
        name: SampleScreen,
        options: {
            animations: {
                push: {
                    content: {
                        alpha: {
                            from: 0,
                            to: 1,
                        }
                    },
                }
            }
        }
    }
});

But it works really strange, as if duration isn't taken into account and all the other screen parts' animations get deleted if you specify only one part, e.g. when you only want to override animation for the topBar, content default animation seems to be removed.

I'm also trying to figure out how to animate on a setRoot call. The docs for animation suggest that it's only applied on push or showModal, but I'm really hoping that's not the case...

Related to this issue: #3500

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

The issue has been closed for inactivity.

I'm also trying to figure out how to animate on a setRoot call. The docs for animation suggest that it's only applied on push or showModal, but I'm really hoping that's not the case...

The docs here says you can animate startApp, I tried but it doesn't work either.

@LRNZ09 I updated to docs. startApp animation was renamed to setRoot and is supported only on Android

@guyca Is there any roadmap to have this feature on iOS too?

Was this page helpful?
0 / 5 - 0 ratings