fix: render fallback only if linking is enabled. closes #8161

This commit is contained in:
Satyajit Sahoo
2020-05-01 00:27:42 +02:00
parent 1ee3038a4d
commit 1c075ffb16
2 changed files with 1 additions and 5 deletions

View File

@@ -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<NavigationContainerRef>(null);
const [theme, setTheme] = React.useState(DefaultTheme);
const [isReady, setIsReady] = React.useState(false);
@@ -208,7 +205,6 @@ export default function App() {
<StatusBar barStyle={theme.dark ? 'light-content' : 'dark-content'} />
)}
<NavigationContainer
ref={containerRef}
initialState={initialState}
onStateChange={(state) =>
AsyncStorage.setItem(

View File

@@ -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;