From 841ae1fbce4d32182c4e411b27defd372edb1570 Mon Sep 17 00:00:00 2001 From: Yogev Ben David Date: Mon, 25 Apr 2022 15:10:38 +0300 Subject: [PATCH] Fix auto link on react-native 68+ (#7507) --- autolink/postlink/appDelegateLinker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autolink/postlink/appDelegateLinker.js b/autolink/postlink/appDelegateLinker.js index cff0dab978c..d5f265c8640 100644 --- a/autolink/postlink/appDelegateLinker.js +++ b/autolink/postlink/appDelegateLinker.js @@ -104,7 +104,7 @@ class AppDelegateLinker { return content.replace( /RCTBridge.*];/, 'RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n' + - '[ReactNativeNavigation bootstrapWithBridge:bridge];' + '[ReactNativeNavigation bootstrapWithBridge:bridge];' ); } @@ -146,6 +146,7 @@ class AppDelegateLinker { const toRemove = [ /RCTRootView\s+\*rootView((.|\r|\s)*?)];\s+/, + /UIView \*rootView = RCTAppSetupDefaultRootView\(bridge, @".*", nil\);/, /if \(@available\(iOS 13\.0, \*\)\)\s{\s+ rootView.backgroundColor((.|\r)*)];\s+}\s+else {[^}]*}/, /self.window((.|\r)*)];\s+/, /UIViewController\s\*rootViewController((.|\r)*)];\s+/, @@ -169,7 +170,7 @@ class AppDelegateLinker { ' No elements could be removed. Check the manual installation docs to verify that everything is properly setup:\n https://wix.github.io/react-native-navigation/docs/installing#native-installation' ); } else { - throw new Error( + warnn( 'Some elements were removed. Check the manual installation docs to verify that everything is properly setup:\n https://wix.github.io/react-native-navigation/docs/installing#native-installation' ); }