From 5adb650ece98a3b12ddda766ec7e6fe09d0965ac Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Mon, 2 Sep 2019 11:41:34 +0200 Subject: [PATCH] fix: fixed `onTransitionStart` exception --- src/createSharedElementStackNavigator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createSharedElementStackNavigator.tsx b/src/createSharedElementStackNavigator.tsx index 4e601c3..58e755e 100644 --- a/src/createSharedElementStackNavigator.tsx +++ b/src/createSharedElementStackNavigator.tsx @@ -46,14 +46,14 @@ function createSharedElementEnabledNavigator( outputRange: index > prevIndex ? [0, 1] : [2, 1], }) ); - if (navigatorConfig.onTransitionStart) { + if (navigatorConfig && navigatorConfig.onTransitionStart) { navigatorConfig.onTransitionStart(transitionProps, prevTransitionProps); } }, onTransitionEnd: (transitionProps: any, prevTransitionProps: any) => { // console.log('onTransitionEnd: ', transitionProps, prevTransitionProps); rendererData.endTransition(); - if (navigatorConfig.onTransitionEnd) { + if (navigatorConfig && navigatorConfig.onTransitionEnd) { navigatorConfig.onTransitionEnd(transitionProps, prevTransitionProps); } },