title: Stuck on splashscreen
body: <p>A splashscreen was added to react native (0.59) app with react navigation (3.9) on android emulator. Here is the component <code>SplashScreen</code>:</p>
  
  <pre><code>import React, { Component} from 'react';
  import {Platform, StyleSheet, Text, View} from 'react-native';
  import helper from "../../lib/helper";
  
  class SplashScreen extends React.Component {
      performTimeConsumingTask = async() =&gt; {
        var result, user;
        try {
        result = await helper.getJwtToken();
        if (result) {
          user = await helper._getUser(result.password, result.username); 
          if (user) {
              return {
                  user,
                  result,
                  success: true
                }      
          } else {
              return {
                  user: null,
                  result: result,
                  success: true
                }      
          };
        } else {
              return {
              user: null,
              result: null,
              success: true
              };
        };
       } catch (err) {
        console.log("Error in retrieving token : ", err);
        return {
          success: false,
          error: err.message
        };
  
      };
      }
  
      async componentDidMount() {
          const data = await this.performTimeConsumingTask();
          if (data !== null &amp;&amp; data.user !== null &amp;&amp; data.success === true) {
              this.props.navigation.navigate('App', {params  : data});
          }
      }
  
      render() {
          return (
            &lt;View style={styles.viewStyles}&gt;
              &lt;Text style={styles.textStyles}&gt;
                Blitz Reading
              &lt;/Text&gt;
            &lt;/View&gt;
          );
        }
      }
  
      const styles = {
        viewStyles: {
          flex: 1,
          alignItems: 'center',
          justifyContent: 'center',
          backgroundColor: 'orange'
        },
        textStyles: {
          color: 'white',
          fontSize: 40,
          fontWeight: 'bold'
        }
      }
  
      export default SplashScreen;
  </code></pre>
  
  <p>A local data is retrieved after splash screen is mounted. Then the retrieved <code>data</code> is passed back to <code>App.js</code> as params. Here is the <code>App.js</code>:</p>
  
  <pre><code>import React, {Component} from 'react';
  import {Platform, StyleSheet, Text, View} from 'react-native';
  import { createBottomTabNavigator, createSwitchNavigator, createStackNavigator, createAppContainer } from 'react-navigation';
  import Event from './src/components/event/Event.js';
  import Chat from './src/components/chat/Chat.js';
  import Signup from "./src/components/signup/Signup.js";
  import Verif1 from "./src/components/signup/Verif1.js";
  import NewEvent from "./src/components/event/Newevent.js";
  import EditUser from "./src/components/user/Edituser";
  import NewUser from "./src/components/user/Newuser";
  import io from 'socket.io-client';
  import GLOBAL from "./src/lib/global";
  import SplashScreen from "./src/components/splashscreen/SplashScreen";
  
  
  const instructions = Platform.select({
    ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
    android:
      'Double tap R on your keyboard to reload,\n' +
      'Shake or press menu button for dev menu',
  });
  
  //socket.io
  const socket = io(GLOBAL.BASE_URL, {
    //const socket = io(GLOBAL.BASE_URL, {
      transports: ['websocket'],
      jsonp: false
    });
  console.log("socket id in App.js : ", socket.id);    
  
  socket.on('disconnect', (reason) =&gt; {
    // ...
    if (reason === 'io server disconnect') {
  
      socket.connect();
    }
    // else the socket will automatically try to reconnect
  });
  
  console.log("In App.js, token retrieved is : ", this.props);
  const ChatWithSocket = (props) =&gt; (&lt;Chat {...props} socket={socket} /&gt;)
  
  //create the navigator
  const EventStack = createStackNavigator(
    {
      Event:  Event,
      NewEvent: NewEvent,
      Chat: {
        screen: ChatWithSocket,
  
      },
      Signup: Signup,
      Verif1: Verif1,
  
    },  {
      initialRouteName: 'Verif1',
    } 
  );
  
  const UserStack = createStackNavigator(
    {
      NewUser: NewUser,
      EditUser: EditUser,    
    }, {
        initialRouteName: "NewUser",
    }
  
  );
  
  const bottomTabNav = createBottomTabNavigator(
      {
        Event: {screen: EventStack},
        User: {screen: UserStack},
      },
      {
          defaultNavigationOptions: ({ navigation }) =&gt; ({
            tabBarIcon: ({ focused, tintColor }) =&gt; {
              const { routeName } = navigation.state;
              let iconName;
              if (routeName === 'Event') {
                iconName = `ios-information-circle${focused ? '' : '-outline'}`;
              } else if (routeName === 'NewUser') {
                iconName = `ios-options${focused ? '' : '-outline'}`;
              }
  
  
              return &lt;Text&gt;Hello the world!&lt;/Text&gt;
            },
          }),
          tabBarOptions: {
            activeTintColor: 'tomato',
            inactiveTintColor: 'gray',
          },
        }
      );
  
  const InitialNavigator = createSwitchNavigator({
    Splash: SplashScreen,
    App: bottomTabNav,
  });
  
  
  const AppContainer = createAppContainer(InitialNavigator);
  
  export default AppContainer;
  </code></pre>
  
  <p>The splash screen is added to <code>InitialNavigator</code> besides to <code>App</code> screen which should be loaded after splash screen. Here is the app log (console.log is removed from the code for easy read):</p>
  
  <pre><code>05-30 13:08:54.297  6116  6180 I ReactNativeJS: 'socket id in App.js : ', undefined
  05-30 13:08:54.327  6116  6180 I ReactNativeJS: 'In App.js, token retrieved is : ', undefined
  05-30 13:08:54.908  6116  6180 I ReactNativeJS: Running application "emps_app" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
  05-30 13:08:55.167  6116  6180 I ReactNativeJS: In Splashscreen DidMount
  05-30 13:08:55.308  6116  6180 I ReactNativeJS: 'SplashScreen token result is : ', ''
  05-30 13:08:55.309  6116  6180 I ReactNativeJS: Splashscreen result is nothing
  05-30 13:08:55.366  6116  6180 I ReactNativeJS: 'After retrieve in spliashscreen : ', { user: null, result: null, success: true }
  </code></pre>
  
  <p>It seems that the splash screen was rendered successfully with nothing was retrieved (correct!).  The problem is that the app stuck on splash screen and does not move on. </p>