From 8f3c6650103171ad894776d55ae9bdf5f83e5128 Mon Sep 17 00:00:00 2001 From: "satyajit.happy" Date: Sun, 6 Oct 2019 04:30:34 +0200 Subject: [PATCH] fix: use next screen's animation when not focused --- example/App.tsx | 6 +++ example/src/PerScreenTransitions.tsx | 72 ++++++++++++++++++++++++++++ src/views/Stack/Stack.tsx | 42 ++++++++++++++-- 3 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 example/src/PerScreenTransitions.tsx diff --git a/example/App.tsx b/example/App.tsx index 155156f7c..2207347bf 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -17,6 +17,7 @@ import ImageStack from './src/ImageStack'; import TransparentStack from './src/TransparentStack'; import ModalStack from './src/ModalStack'; import ModalPresentation from './src/ModalPresentation'; +import PerScreenTransitions from './src/PerScreenTransitions'; import LifecycleInteraction from './src/LifecycleInteraction'; import GestureInteraction from './src/GestureInteraction'; import SwitchWithStacks from './src/SwitchWithStacks'; @@ -57,6 +58,11 @@ const data: Item[] = [ title: 'Modal (iOS style)', routeName: 'ModalPresentation', }, + { + component: PerScreenTransitions, + title: 'Per screen transitions', + routeName: 'PerScreenTransitions', + }, { component: FullScreen, title: 'Full Screen', routeName: 'FullScreen' }, { component: LifecycleInteraction, diff --git a/example/src/PerScreenTransitions.tsx b/example/src/PerScreenTransitions.tsx new file mode 100644 index 000000000..054e12959 --- /dev/null +++ b/example/src/PerScreenTransitions.tsx @@ -0,0 +1,72 @@ +import * as React from 'react'; +import { Button, View, Text } from 'react-native'; +import { + createStackNavigator, + TransitionPresets, + NavigationStackScreenProps, +} from 'react-navigation-stack'; + +function SlideScreen({ navigation }: NavigationStackScreenProps) { + return ( + + Slide Screen +