I had tried 3 of the following ways. The first one is what I am currently using for android splash screen for react-native projects.
-
Using a npm package written by other.
reference: https://github.com/remobile/react-native-splashscreen
-
Create a
SplashScreen
component and redirect afterward.reference: How to create some kind of Splash screen/Launching screen, which disappears after App loaded? (React Native)
-
Natively in
java
code.reference: https://www.bignerdranch.com/blog/splash-screens-the-right-way/
I have a fetch
request in the componentDidMount()
of initialRoute
.
Using the first way from the list above performs the request while showing the splash screen.
Whereas the second way, needs to wait until the SplashScreen
component get unmounted.
Third way is slightly more codes to write and maintain.