Open batusenyuz opened 2 months ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.7. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
It looks like that documentation should be updated.
In 0.74 a new customizeRootView
function was added - https://github.com/facebook/react-native/pull/42088, which I think can be used something like this:
#import <React/RCTRootView.h>
// ...
- (void)customizeRootView:(RCTRootView *)rootView
{
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
rootView.loadingView = vc.view;
}
In 0.73 probably something like this could work?
#import <React/RCTRootView.h>
// ...
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
moduleName:(NSString *)moduleName
initProps:(NSDictionary *)initProps
{
RCTRootView *rootView = (RCTRootView *)[super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
rootView.loadingView = vc.view;
return rootView;
}
Thanks @mlazari, do you think this will solve the loading issue in the app.tsx file? I want the launchscreen to appear until the renderscreens function is completed.
@batusenyuz Not sure about that, I just indicated where I think is the new place for that code in 0.73 / 0.74. I am not using it and didn't test it, so not sure if that's correct or not.
This https://github.com/facebook/react-native/issues/44195#issuecomment-2072618174 solved my problem on 0.74.0. I am using same "LaunchScreen" in 0.70.14 and it works perfect. But in this version its zooming before the exit. I tried to disable animation but i cant. Is anyone has the same issue?
Hi @caglardurmus, I'm also having the zoom animation issue.
Any solution?
react native library and documentation should be updated according to new updates and this should be done urgently.
@cortinico
We expect support from the community on this issue!
@batusenyuz Could you create a new React Native project with a minimal reproducible example? That would help others to better understand the issue and look into it.
@mlazari @caglardurmus @batusenyuz In our app, we don't have an animated loadingView, but the upgrade from 0.72.5 to 0.73/74 caused the loadingView to be zoomed.
Before upgrading we were setting the loadingView after creating the window but now customizeRootView
is called before.
I was able to prevent this by patching the react-native/Libraries/AppDelegate/RCTAppDelegate.mm
file.
diff --git a/node_modules/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/node_modules/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
index d79fbb4..183be60 100644
--- a/node_modules/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
+++ b/node_modules/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
@@ -65,7 +65,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
}
[self _logWarnIfCreateRootViewWithBridgeIsOverridden];
- [self customizeRootView:(RCTRootView *)rootView];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self createRootViewController];
@@ -74,6 +73,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.windowScene.delegate = self;
[self.window makeKeyAndVisible];
+ [self customizeRootView:(RCTRootView *)rootView];
+
return YES;
}
Description
Hi Everyone,
// 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;
We can no longer paste this code into the AppDelegate.m file. Not working.
https://reactnative.dev/docs/publishing-to-app-store
this code is not working
My app.tsx file is as below.
While waiting for the RenderScreen command, LoadingScreen appears. But I want either MainStack or AuthStack to be opened before this loadingScreen appears. I don't want to use plugins like react-native-splash-screen.
How can I avoid this problem?
How can I avoid this problem?How can I avoid this problem?
PROBLEM VIDEO https://github.com/facebook/react-native/assets/122183314/3ea4dc88-c4ad-4809-816f-5dd7dc205e94
App.tsx
Steps to reproduce
rm -rf node_modules rm -rf ios/Pods yarn npx pod-install ios yarn start yarn ios
React Native Version
0.73.6
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
.
Screenshots and Videos
https://github.com/facebook/react-native/assets/122183314/3ea4dc88-c4ad-4809-816f-5dd7dc205e94