Browse Source

Rename internal getConstants method to prevent conflicts with RN's getConstants method (#5745)

Related to #4861
Guy Carmeli 5 years ago
parent
commit
5e6d6fce13
No account linked to committer's email address

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java View File

79
     }
79
     }
80
     
80
     
81
     @ReactMethod
81
     @ReactMethod
82
-    public void getConstants(Promise promise) {
82
+    public void getNavigationConstants(Promise promise) {
83
         ReactApplicationContext ctx = getReactApplicationContext();
83
         ReactApplicationContext ctx = getReactApplicationContext();
84
         WritableMap constants = Arguments.createMap();
84
         WritableMap constants = Arguments.createMap();
85
         constants.putString(Constants.BACK_BUTTON_JS_KEY, Constants.BACK_BUTTON_ID);
85
         constants.putString(Constants.BACK_BUTTON_JS_KEY, Constants.BACK_BUTTON_ID);

+ 1
- 1
lib/ios/RNNBridgeModule.m View File

102
 	resolve(args);
102
 	resolve(args);
103
 }
103
 }
104
 
104
 
105
-RCT_EXPORT_METHOD(getConstants:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
105
+RCT_EXPORT_METHOD(getNavigationConstants:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
106
 	resolve([Constants getConstants]);
106
 	resolve([Constants getConstants]);
107
 }
107
 }
108
 
108
 

+ 1
- 1
lib/src/adapters/Constants.ts View File

9
 
9
 
10
 export class Constants {
10
 export class Constants {
11
   static async get(): Promise<NavigationConstants> {
11
   static async get(): Promise<NavigationConstants> {
12
-    const constants: NavigationConstants = await NativeModules.RNNBridgeModule.getConstants();
12
+    const constants: NavigationConstants = await NativeModules.RNNBridgeModule.getNavigationConstants();
13
     return new Constants(constants);
13
     return new Constants(constants);
14
   }
14
   }
15
 
15