diff --git a/src/createSharedElementScene.tsx b/src/createSharedElementScene.tsx index 3355d5f..4160036 100644 --- a/src/createSharedElementScene.tsx +++ b/src/createSharedElementScene.tsx @@ -19,8 +19,12 @@ type PropsType = { }; function getActiveRouteState(route: any): any { - if (!route.routes || route.routes.length === 0 || route.index >= route.routes.length) { - return route; + if ( + !route.routes || + route.routes.length === 0 || + route.index >= route.routes.length + ) { + return route; } else { return getActiveRouteState(route.routes[route.index]); } diff --git a/src/createSharedElementStackNavigator.tsx b/src/createSharedElementStackNavigator.tsx index f763112..4aaa80b 100644 --- a/src/createSharedElementStackNavigator.tsx +++ b/src/createSharedElementStackNavigator.tsx @@ -24,10 +24,7 @@ function createSharedElementEnabledNavigator( typeof routeConfig === 'object' && routeConfig.screen ? routeConfig.screen : routeConfig; - const wrappedComponent = createSharedElementScene( - component, - rendererData - ); + const wrappedComponent = createSharedElementScene(component, rendererData); if (component === routeConfig) { wrappedRouteConfigs[key] = wrappedComponent; } else {