iOS Development

React Native – [IOS] – Bought a clean display after SplashScreen.cover()

Spread the love


  • React Native Navigation model: 7.37.2
  • React Native model: 0.71.15
  • react-native-navigation: 7.37.2
  • react-native-splash-screen: 3.3.0
  • Has Cloth (React Native’s new rendering system) enabled: no
  • Node model: 21.5.0
  • System mannequin: iphone13
  • iOS model: 16.2

I received a clean display after SplashScreen.cover(), even when the SignInScreen’s render() has been referred to as

Navigation.registerComponent(appName, () => (props) => <StoreProvider retailer={retailer}>
  <App {...props}/>
</StoreProvider>, () => App);

Navigation.registerComponent('app.SignInScreen', () => (props) => <Supplier retailer={retailer}>
  <SignInScreen {...props}/>
</Supplier>, () => SignInScreen);

Navigation.registerComponent('app.ScanningScreen', () => (props) => <Supplier retailer={retailer}>
  <ScanningScreen {...props}/>
</Supplier>, () => ScanningScreen);

Navigation.occasions().registerAppLaunchedListener(async () => {
  let session = await checkForPreviousSession() || {};  <--  invoke `SplashScreen.cover()` on this perform
  Navigation.setRoot({
    root: {
      stack: {
        youngsters: [
          {
            component: {
              name: Object.keys(session).length ? 'app.ScanningScreen' : 'app.SignInScreen' // unique ID registered with Navigation.registerScreen
            },
          },
        ],
        choices: {
          statusBar: {
            backgroundColor: COLORS.BLUE,
            model: session ? 'gentle' : 'darkish'
          },
          topBar: { seen: false, peak: 0 },
          format: {
            orientation: ['portrait'], // should be outlined in root and inside subsequent screens
          },
        },
      },
    },
  });
});

Podfile:

use_react_native!(
  :path => config[:reactNativePath],
  # to allow hermes on iOS, change `false` to `true` after which set up pods
  :hermes_enabled => true, #flags[:hermes_enabled],
  :fabric_enabled => false, #flags[:fabric_enabled],
  # An absolute path to your utility root.
  :flipper_configuration => flipper_config,
  :app_path => "#{Pod::Config.occasion.installation_root}/.."
)

Reinstall the dependencies

3 thoughts on “React Native – [IOS] – Bought a clean display after SplashScreen.cover()

  1. My brother suggested I might like this blog He was totally right This post actually made my day You can not imagine simply how much time I had spent for this info Thanks

  2. Wow superb blog layout How long have you been blogging for you make blogging look easy The overall look of your site is magnificent as well as the content

Leave a Reply

Your email address will not be published. Required fields are marked *