13

I've used expo for a while now and have switched to react-native-init without expo.

I've been very comfortable working without expo (thanks Github) but somehow I am unable to find a solution with much googling, for a similar feature to AppLoading in Expo ( https://docs.expo.io/versions/latest/sdk/app-loading ). Maybe I'm not using the correct keywords, I keep getting results for react native fast image etc which just preload images from cache.

I've already set up the Launch screen in Xcode, I would like to network request, load some data into my redux store, preload images and some fonts, before my Launch screen switches to my first screen.

Can someone provide me with a solution or a link to the solution?

Someone Special
  • 12,479
  • 7
  • 45
  • 76

3 Answers3

9

react-native-splash-screen meets your requirement!

Ericgit
  • 6,089
  • 2
  • 42
  • 53
NSYuJian
  • 196
  • 1
  • 5
4

As of 2022,

You may try react-native-bootsplash

In case, react-native-splash-screen is not suitable for you.

cYee
  • 1,915
  • 1
  • 16
  • 24
0

I managed it to just do a simple loading placeholder. While loading you have loadingState == true. If it finished to fetch user data e.g. it will load your normal screen, navigation or whatever



  if (loginState == true){
    return(
      <View style={{flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "#000000"}}>
        <Text style={{color: "#FFFFFF", fontSize: 27, fontFamily: "Poppins-SemiBold"}}>Loading</Text>
        <ActivityIndicator size="large" color="#FFFFFF" />
      </View>
    )
  };
  • You've proposed an incorrect solution to the original poster's question. Your code would still display a white/blank splash screen for a fraction of a second while the user auth is loading. We are trying to customize the background color that's shown for only a fraction of a second (right before the app starts running). – Zernach Jan 26 '23 at 16:58