From 1c075ffb169d233ed0515efea264a5a69b4de52e Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 1 May 2020 00:27:42 +0200 Subject: [PATCH] fix: render fallback only if linking is enabled. closes #8161 --- example/src/index.tsx | 4 ---- packages/native/src/NavigationContainer.tsx | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/example/src/index.tsx b/example/src/index.tsx index 3196bf37..023b0e78 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -25,7 +25,6 @@ import { } from 'react-native-paper'; import { InitialState, - NavigationContainerRef, NavigationContainer, DefaultTheme, DarkTheme, @@ -129,8 +128,6 @@ const THEME_PERSISTENCE_KEY = 'THEME_TYPE'; Asset.loadAsync(StackAssets); export default function App() { - const containerRef = React.useRef(null); - const [theme, setTheme] = React.useState(DefaultTheme); const [isReady, setIsReady] = React.useState(false); @@ -208,7 +205,6 @@ export default function App() { )} AsyncStorage.setItem( diff --git a/packages/native/src/NavigationContainer.tsx b/packages/native/src/NavigationContainer.tsx index dfa0ebce..0b321d1d 100644 --- a/packages/native/src/NavigationContainer.tsx +++ b/packages/native/src/NavigationContainer.tsx @@ -54,7 +54,7 @@ const NavigationContainer = React.forwardRef(function NavigationContainer( const linkingContext = React.useMemo(() => ({ options: linking }), [linking]); - if (!isReady) { + if (isLinkingEnabled && !isReady) { // This is temporary until we have Suspense for data-fetching // Then the fallback will be handled by a parent `Suspense` component return fallback as React.ReactElement;