Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto link on react-native 68+ #7507

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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