Skip to content

Commit

Permalink
Fix auto link on react-native 68+ (#7507)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored Apr 25, 2022
1 parent 32d975d commit 841ae1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autolink/postlink/appDelegateLinker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];'
);
}

Expand Down Expand Up @@ -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+/,
Expand All @@ -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'
);
}
Expand Down

0 comments on commit 841ae1f

Please sign in to comment.