Closed lobydev closed 2 years ago
is there no solution?
@lobydev change type of rootView to RCTRootView instead of UIView. You will need to type case RCTAppSetupDefaultRootView as well.
So changing line number 44 to
RCTRootView *rootView = (RCTRootView *)RCTAppSetupDefaultRootView(bridge, @"Furya", nil);
should solve the problem
YES
from UIView rootView = RCTAppSetupDefaultRootView(bridge, @"XXXX", nil); to RCTRootView rootView = (RCTRootView *)RCTAppSetupDefaultRootView(bridge, @"XXXX", nil);
work for me!
Closing as this is resolved
Even with the recommended change by @pragadeeshk I still see the screen flash white briefly between the launchscreen and the initial render. It's better than without the code, but wasn't seeing the white frames before.
Hey, @ecexplorer. Have you managed to solve this?
@cortinico It seems like this isn't solved.
The issue here is that the code that implements the mechanism to prevent the flash in RCTRootView
's has no equivalent in RCTSurfaceHostingProxyRootView
. So the issue persists when Fabric is enabled, even though the workaround proposed by @pragadeeshk fixes the issue if not, since the view instantiated is actually a RCTRootView
in that case.
Maybe this should be reopened?
Edit: Currently I'm using this unideal workaround:
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
[rootView addSubview:vc.view];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[[vc view] removeFromSuperview];
});
@cortinico It seems like this isn't solved.
Can I ask you to create a newer issue + provide a reproducer for this specific scenario? We're having a hard time tracking closed issues which receives follow-up comments so they get downprioritized. Please use the "New Architecture" issue as this looks like Fabric related.
Description
// Place this code after "[self.window makeKeyAndVisible]" and before "return YES;" UIStoryboard sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil]; UIViewController vc = [sb instantiateInitialViewController]; rootView.loadingView = vc.view;
this code is not working
Version
0.68.0
Output of
npx react-native info
System: OS: macOS 12.3 CPU: (10) arm64 Apple M1 Max Memory: 795.16 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.8.0 - /opt/homebrew/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.5.5 - /opt/homebrew/bin/npm Watchman: 2022.03.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0 => 0.68.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
the code is not working
// Place this code after "[self.window makeKeyAndVisible]" and before "return YES;" UIStoryboard sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil]; UIViewController vc = [sb instantiateInitialViewController]; rootView.loadingView = vc.view;
Snack, code example, screenshot, or link to a repository
No response