Make position a native animated value on initialization to fix https://github.com/react-navigation/react-navigation/issues/4886

This commit is contained in:
Brent Vatne 2018-08-23 15:47:11 -07:00
parent b2b4f16e38
commit ab0fd3d0ee
1 changed files with 14 additions and 1 deletions

View File

@ -1,9 +1,18 @@
import React from 'react';
import { Animated, Easing, StyleSheet, View } from 'react-native';
import {
Animated,
NativeModules,
Easing,
StyleSheet,
View,
} from 'react-native';
import invariant from '../utils/invariant';
import NavigationScenesReducer from './ScenesReducer';
const NativeAnimatedModule =
NativeModules && NativeModules.NativeAnimatedModule;
// Used for all animations unless overriden
const DefaultTransitionSpec = {
duration: 250,
@ -38,6 +47,10 @@ class Transitioner extends React.Component {
),
};
if (NativeAnimatedModule) {
this.state.position.__makeNative();
}
this._prevTransitionProps = null;
this._transitionProps = buildTransitionProps(props, this.state);
this._isMounted = false;