Ad

React Native Android Transition Without Animaiton

- 1 answer

How do I transition between scenes without animations using Navigator?

When I do a Navigator.replace(), the view just switches instantly, I'd like to replicate this behavior with a Navigator.push() call.

I've been playing around with SceneConfigs and feel like that might be the right solution, but can't get it to work.

Ad

Answer

I found a hacky solution here. https://github.com/facebook/react-native/issues/1953

var NoTransition = { opacity: { from: 1, to: 1, min: 1, max: 1, type: 'linear', extrapolate: false, round: 100, }, };

return  {
            ...Navigator.SceneConfigs.FloatFromLeft,
            gestures: null,
            defaultTransitionVelocity: 100,
            animationInterpolators: {
              into: buildStyleInterpolator(NoTransition),
              out: buildStyleInterpolator(NoTransition),
            },
        };
Ad
source: stackoverflow.com
Ad