yarn react-native-bootsplash 4.3.1

latest releases: 6.3.1, 6.3.0, 6.2.6...
2 years ago
  • Update the Android setup documentation (no code changes). It's now recommended to use onCreate instead of loadApp to init react-native-bootsplash as soon as possible (fix #379):
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;

+ import android.os.Bundle;
import com.zoontek.rnbootsplash.RNBootSplash;

public class MainActivity extends ReactActivity {

  // …

+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+   RNBootSplash.init(this); // <- initialize the splash screen
+   super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
+ }

  public static class MainActivityDelegate extends ReactActivityDelegate {

    // …

-   @Override
-   protected void loadApp(String appKey) {
-     RNBootSplash.init(getPlainActivity()); // <- initialize the splash screen
-     super.loadApp(appKey);
-   }
  }
}

Don't miss a new react-native-bootsplash release

NewReleases is sending notifications on new releases.