fix: make sure new state events are emitted when new navigators mount

This commit is contained in:
Satyajit Sahoo
2020-07-19 14:52:43 +02:00
parent b2a99c2a88
commit af8b27414c
6 changed files with 138 additions and 10 deletions

View File

@@ -147,6 +147,10 @@ export default function SimpleStackScreen({
[]
);
if (state.isLoading) {
return <SplashScreen />;
}
return (
<AuthContext.Provider value={authContext}>
<SimpleStack.Navigator
@@ -156,13 +160,7 @@ export default function SimpleStackScreen({
),
}}
>
{state.isLoading ? (
<SimpleStack.Screen
name="Splash"
component={SplashScreen}
options={{ title: 'Auth Flow' }}
/>
) : state.userToken === undefined ? (
{state.userToken === undefined ? (
<SimpleStack.Screen
name="SignIn"
options={{