react-native-navigation 7.35.0 → 7.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,6 +98,11 @@ class ApplicationLinker {
98
98
  }
99
99
 
100
100
  _extendNavigationHost(applicationContent) {
101
+ if (this._hasAlreadyLinkedNavigationHost(applicationContent)) {
102
+ warnn(' NavigationReactNativeHost is already used, skipping.');
103
+ return applicationContent;
104
+ }
105
+
101
106
  if (this._doesExtendReactNativeHost(applicationContent)) {
102
107
  debugn(' Changing host implementation to NavigationReactNativeHost');
103
108
  return applicationContent
@@ -106,11 +111,14 @@ class ApplicationLinker {
106
111
  'import com.facebook.react.ReactNativeHost;',
107
112
  'import com.facebook.react.ReactNativeHost;\nimport com.reactnativenavigation.react.NavigationReactNativeHost;'
108
113
  );
109
- }
110
-
111
- if (this._hasAlreadyLinkedNavigationHost(applicationContent)) {
112
- warnn(' NavigationReactNativeHost is already used, skipping.');
113
- return applicationContent;
114
+ } else if (this._doesExtendDefaultReactNativeHost(applicationContent)) {
115
+ debugn(' Changing host implementation to NavigationReactNativeHost');
116
+ return applicationContent
117
+ .replace('new DefaultReactNativeHost(this)', 'new NavigationReactNativeHost(this)')
118
+ .replace(
119
+ 'import com.facebook.react.defaults.DefaultReactNativeHost;',
120
+ 'import com.facebook.react.defaults.DefaultReactNativeHost;\nimport com.reactnativenavigation.react.NavigationReactNativeHost;'
121
+ );
114
122
  }
115
123
 
116
124
  throw new Error('There was a problem extending NavigationReactNativeHost().');
@@ -120,6 +128,10 @@ class ApplicationLinker {
120
128
  return /\s*new ReactNativeHost\(this\)\s*/.test(applicationContent);
121
129
  }
122
130
 
131
+ _doesExtendDefaultReactNativeHost(applicationContent) {
132
+ return /\s*new DefaultReactNativeHost\(this\)\s*/.test(applicationContent);
133
+ }
134
+
123
135
  _hasAlreadyLinkedNavigationHost(applicationContent) {
124
136
  return /\s*new NavigationReactNativeHost\(this\)\s*/.test(applicationContent);
125
137
  }
@@ -3,7 +3,7 @@ var path = require('./path');
3
3
  var fs = require('fs');
4
4
  var { warnn, errorn, logn, infon, debugn } = require('./log');
5
5
  var { insertString } = require('./stringUtils');
6
- var DEFAULT_KOTLIN_VERSION = '1.5.31';
6
+ var DEFAULT_KOTLIN_VERSION = '1.7.10';
7
7
  // This should be the minSdkVersion required for RNN.
8
8
  var DEFAULT_MIN_SDK_VERSION = 21;
9
9
 
@@ -74,7 +74,7 @@ class GradleLinker {
74
74
  return contents;
75
75
  }
76
76
 
77
- var match = /classpath\s*\(*["']com\.android\.tools\.build:gradle:/.exec(contents);
77
+ var match = /classpath\s*\(*["']com\.android\.tools\.build:gradle.*/.exec(contents);
78
78
  if (match) {
79
79
  debugn(' Adding Kotlin plugin');
80
80
  return insertString(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.35.0",
3
+ "version": "7.35.1",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,