Posts

Animate leaving screen with React Navigation

Image
8 2 I am developing a React Native application which uses React Navigation to manage the routing between screens. I know reading React Navigation documentation and watching this video on Egghead.io (highly suggested) that is possible to define custom animations for transitions between screens passing the transitionConfig property to a StackNavigator . For example, the following code is defining a slide from left animation that is basically the mirror of the iOS default push animation: const TransitionConfig = () => ({ screenInterpolator: ({ layout, position, scene }) => { const { index } = scene const { initWidth } = layout const translateX = position.interpolate({ inputRange: [index - 1, index, index + 1], outputRange: [-initWidth, 0, 0], ...