react-native-restart icon indicating copy to clipboard operation
react-native-restart copied to clipboard

Showing a white screen with RNRestart.Restart().

Open saadi-ninjasCode opened this issue 2 years ago • 14 comments

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().

  • Previous Solution Show the splash screen when calling RNRestart.Restart() #194 , #158

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.

saadi-ninjasCode avatar Feb 10 '23 07:02 saadi-ninjasCode

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

avishayil avatar Feb 16 '23 21:02 avishayil

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.

saadi-ninjasCode avatar Feb 17 '23 05:02 saadi-ninjasCode

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?

avishayil avatar Feb 17 '23 07:02 avishayil

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

saadi-ninjasCode avatar Feb 17 '23 07:02 saadi-ninjasCode

any lucky anyone?

UmerHayyat54 avatar Apr 06 '23 07:04 UmerHayyat54

any update related to this ??

Kailash-dev avatar Aug 02 '23 06:08 Kailash-dev

same issue here!

Ozaoujal avatar Sep 07 '23 09:09 Ozaoujal

i am also facing this issue

asadalihazoori avatar Nov 01 '23 14:11 asadalihazoori

same issue

art9mid avatar Nov 01 '23 22:11 art9mid

any solution now?

fukemy avatar Dec 13 '23 07:12 fukemy

facing the same issue solution required

asadalihazoori avatar Dec 21 '23 13:12 asadalihazoori

Try enabling hermes.

elabayoub avatar Feb 29 '24 10:02 elabayoub

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 avatar Apr 16 '24 21:04 ansmlc

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

ansmlc avatar Apr 16 '24 22:04 ansmlc