Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The white screen that appears after using RNRestart.Restart() #238

Open
Engraulis61 opened this issue Apr 3, 2023 · 8 comments
Open

The white screen that appears after using RNRestart.Restart() #238

Engraulis61 opened this issue Apr 3, 2023 · 8 comments

Comments

@Engraulis61
Copy link

I want to show a splash screen to the user after calling rnrestart.restart().

In older versions of React, I could solve this problem by adding code to the AppDelegate.mm file. However, since the AppDelegate.mm file has changed, I am unable to display the splash screen after using the RNrestart.Restart() command.

I used to use these codes in old versions of React Native:

RCTRootView *rootView = RCTAppSetupDefaultRootView(bridge, @"appname", nil);

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController vc = [sb instantiateInitialViewController];
UIView launchScreenView = vc.view;
launchScreenView.frame = self.window.bounds;
RCTRootView.loadingView = launchScreenView;

Is there anyone who can help with a solution for this problem?

@UmerHayyat54
Copy link

i am also facing same issue

@faizanviwell
Copy link

Facing the same issue

@Melekhin
Copy link

and me, too.

Any of the solutions through the use of react-native-splash-screen or react-native-bootsplash modules?
or custom splash screen..

@mehthabux
Copy link
Contributor

any solution for this ?

@hfarhanahmed
Copy link

I am facing same issue

@ansmlc
Copy link

ansmlc commented Apr 16, 2024

Same issue :(

@Asad520
Copy link

Asad520 commented Sep 25, 2024

Facing the same issue. Did anybody find a solution for this?

@ChadyAyoub4
Copy link

This issue is not from the package, You can set the root view background color to your app by adding this code

  • (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
    UIView *rootView = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

    rootView.backgroundColor = [UIColor colorWithRed:(23.0 / 255.0) green:(23.0 / 255.0) blue:(23.0 / 255.0) alpha:(1.0)];
    return rootView;
    }

in your appdelegate.mm file and you will get the desired color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants