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,7 +79,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
79 79
     }
80 80
     
81 81
     @ReactMethod
82
-    public void getConstants(Promise promise) {
82
+    public void getNavigationConstants(Promise promise) {
83 83
         ReactApplicationContext ctx = getReactApplicationContext();
84 84
         WritableMap constants = Arguments.createMap();
85 85
         constants.putString(Constants.BACK_BUTTON_JS_KEY, Constants.BACK_BUTTON_ID);

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

@@ -102,7 +102,7 @@ RCT_EXPORT_METHOD(getLaunchArgs:(NSString*)commandId :(RCTPromiseResolveBlock)re
102 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 106
 	resolve([Constants getConstants]);
107 107
 }
108 108
 

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

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