zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.61k stars 250 forks source link

[Expo - iOS] react-native 0.74.3 breaks the splash screen #590

Closed antFrancon closed 1 month ago

antFrancon commented 1 month ago

Before submitting a new issue

Bug summary

After upgrading React Native to version 0.74.3, the splash screen feature is broken on iOS.

Specifically:

This issue may be related to this commit in the last RN release: Support customizeRootView from RCTRootViewFactory.

Library version

5.5.3

Environment info

// Old architecture
"react": "18.2.0",
"react-native": "0.74.2",
"react-native-bootsplash": "^5.5.3",

// Dev
"@react-native/babel-preset": "0.74.84",
"@react-native/eslint-config": "0.74.84",
"@react-native/metro-config": "0.74.84",
"@react-native/typescript-config": "0.74.84",

Steps to reproduce

  1. Run the example with RN 0.74.2 --> ✅
  2. Upgrade to RN 0.74.3 --> ❌

I tested both in dev and release mode.

Reproducible sample code

Run the example including the useHideAnimation part.

zoontek commented 1 month ago

@antFrancon Are you using Expo?

antFrancon commented 1 month ago

@antFrancon Are you using Expo?

Oh yes, of course, I forgot that. I am using Expo Bare Workflow. So I did the native iOS setup

- (void)customizeRootView:(RCTRootView *)rootView {
  [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView]; // ⬅️ initialize the splash screen
}
"expo": "51.0.15",
zoontek commented 1 month ago

Yeah, Expo fixed compat issues with react-native-bootsplash, I have to ship v6 this weekend

zoontek commented 1 month ago

@antFrancon After investigation, it appears that if the new expo release fix the issue with customizeRootView, it also introduces a small regression with the internal splash screen module (?).

There is no issue with bare react-native 0.74.3.

EDIT: Using v6 beta, it works, but I still cannot apply the customizeRootView patch, and has to stick with createRootViewWithBridge still 😕

Kudo commented 1 month ago

not sure whether https://github.com/expo/expo/pull/30245 helps for the issue?

zoontek commented 1 month ago

@Kudo Yes, this is what missing! I though it was already supported, my bad.

Also, if called (or if expo-splash-screen is not installed), expo should not hide the added loadingView (UIView*).

Kudo commented 1 month ago

it's my bad that to miss i have copied code inside expo. the fix is merged and should be published next week.

Also, if called (or if expo-splash-screen is not installed), expo should not hide the added loadingView (UIView*).

could you elaborate this case more? or a repro would be much appreciated. i tried the following stack and it doesn't appear problems. maybe i miss anything.

zoontek commented 1 month ago

could you elaborate this case more? or a repro would be much appreciated. i tried the following stack and it doesn't appear problems. maybe i miss anything.

I just didn't though too much before talking, the issue was that it's not called, not that expo remove the UIView 😅

This will fix it! Thanks a lot @Kudo

zoontek commented 1 month ago

Expo 51.0.20 supports customizeRootView, the latest beta includes the fix: https://github.com/zoontek/react-native-bootsplash/pull/578

Everything is finally ready for v6 stable 😮‍💨