Tuesday, January 30, 2024
HomeiOS DevelopmentReact Native - - Obtained a clean display screen after SplashScreen.conceal()

React Native – [IOS] – Obtained a clean display screen after SplashScreen.conceal()


  • 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
  • Machine mannequin: iphone13
  • iOS model: 16.2

I acquired a clean display screen after SplashScreen.conceal(), even when the SignInScreen’s render() has been known 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.conceal()` 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,
            type: 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 software root.
  :flipper_configuration => flipper_config,
  :app_path => "#{Pod::Config.occasion.installation_root}/.."
)

Reinstall the dependencies



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments