How does one set a splash screen for react-native android, I can't find anything on the topic and I thought it was odd.
Thanks
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.
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.