diff --git a/src/view/shell/createNativeStackNavigatorWithAuth.tsx b/src/view/shell/createNativeStackNavigatorWithAuth.tsx index 6ce2dd3eef..e5a9e0a636 100644 --- a/src/view/shell/createNativeStackNavigatorWithAuth.tsx +++ b/src/view/shell/createNativeStackNavigatorWithAuth.tsx @@ -47,6 +47,8 @@ type NativeStackNavigationOptionsWithAuth = NativeStackNavigationOptions & { requireAuth?: boolean } +let prevActiveRouteName: string | undefined + function NativeStackNavigator({ id, initialRouteName, @@ -115,10 +117,6 @@ function NativeStackNavigator({ const {setShowLoggedOut} = useLoggedOutViewControls() const {isMobile} = useWebMediaQueries() const {leftNavMinimal} = useLayoutBreakpoints() - const prevActiveRouteName = React.useRef(undefined) - React.useEffect(() => { - prevActiveRouteName.current = activeRoute.name - }, [activeRoute.name]) if (!hasSession && (activeRouteRequiresAuth || IS_NATIVE)) { return @@ -157,7 +155,7 @@ function NativeStackNavigator({