avishayil / react-native-restart

React Native Package With One Purpose: To Restart Your React Native Project
MIT License
942 stars 150 forks source link

Showing a white screen with RNRestart.Restart(). #233

Open saadi-ninjasCode opened 1 year ago

saadi-ninjasCode commented 1 year ago

First of all sorry to recreate the issue, All previously related issues are closed and their solutions are not acceptable anymore because of the latest version of React-Native.

Problem:

There is a white screen when we call RNRestart.Restart().

In the above Solution, people mention the library react-native-splash-screen, which is no longer maintained. While there is another up-to-date library react-native-bootsplash, Previously library has support to show the splash screen (Once splash screen hides).

New Issue

react-native-bootsplash removed support to show the splash screen (Once splash screen hides) in latest version when giving support for Android 12. -Reason: Can't be possible with AndroidX core splash screen module and https://github.com/zoontek/react-native-bootsplash/issues/354#issuecomment-1130346424

Solution

Any help would be greatly appreciated.

avishayil commented 1 year ago

Thanks @saadi-ninjasCode for the detailed issue. Could you please help me in some detailed step in how to replicate the issue?

saadi-ninjasCode commented 1 year ago

Thanks @saadi-ninjasCode for the detailed issue. Could you please help me in some detailed step in how to replicate the issue?

Yeah Sure, First of all, You can create a simple RN project and add a button on the screen. On pressing button call the restart function from react-native-restart. You will see a blank white/black (Dependent on mobile theme). I will provide the Expo Snack for you. But I'm little bit busy now.

avishayil commented 1 year ago

Thanks @saadi-ninjasCode for the detailed issue. Could you please help me in some detailed step in how to replicate the issue?

Yeah Sure, First of all, You can create a simple RN project and add a button on the screen. On pressing button call the restart function from react-native-restart. You will see a blank white/black (Dependent on mobile theme). I will provide the Expo Snack for you. But I'm little bit busy now.

Just to understand, like in the gif that is shown on the README, until the app is restarted, white screen is shown? What would be the expected behavior in your mind?

saadi-ninjasCode commented 1 year ago

Thanks @saadi-ninjasCode for the detailed issue. Could you please help me in some detailed step in how to replicate the issue?

Yeah Sure, First of all, You can create a simple RN project and add a button on the screen. On pressing button call the restart function from react-native-restart. You will see a blank white/black (Dependent on mobile theme). I will provide the Expo Snack for you. But I'm little bit busy now.

Just to understand, like in the gif that is shown on the README, until the app is restarted, white screen is shown? What would be the expected behavior in your mind?

In my opinion, there should be a splash screen or the icon of an app in the center of the screen (As Android 12 allows only a icon now). Android 12 Splash Screen

UmerHayyat54 commented 1 year ago

any lucky anyone?

Kailash-dev commented 1 year ago

any update related to this ??

Ozaoujal commented 1 year ago

same issue here!

asadalihazoori commented 1 year ago

i am also facing this issue

art9mid commented 1 year ago

same issue

fukemy commented 11 months ago

any solution now?

asadalihazoori commented 11 months ago

facing the same issue solution required

ansmlc commented 7 months ago

Try enabling hermes.

Is that supposed to help with removing white screen?

I'm using RN 0.73 which should mean Hermes is enabled by default, but have the same issue.

ansmlc commented 7 months ago

For anyone looking for an alternative solution (no white screen):

import { reloadAsync } from 'expo-updates'; 
reloadAsync();

Source: https://stackoverflow.com/questions/57330046/how-to-restart-app-react-native-and-expo