Skip to content

Commit

Permalink
Rename internal getConstants method to prevent conflicts with RN's ge…
Browse files Browse the repository at this point in the history
…tConstants method (#5745)

Related to #4861
  • Loading branch information
guyca authored Dec 8, 2019
1 parent 2bde14d commit 5e6d6fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void getLaunchArgs(String commandId, Promise promise) {
}

@ReactMethod
public void getConstants(Promise promise) {
public void getNavigationConstants(Promise promise) {
ReactApplicationContext ctx = getReactApplicationContext();
WritableMap constants = Arguments.createMap();
constants.putString(Constants.BACK_BUTTON_JS_KEY, Constants.BACK_BUTTON_ID);
Expand Down
2 changes: 1 addition & 1 deletion lib/ios/RNNBridgeModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ -(instancetype)initWithCommandsHandler:(RNNCommandsHandler *)commandsHandler {
resolve(args);
}

RCT_EXPORT_METHOD(getConstants:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
RCT_EXPORT_METHOD(getNavigationConstants:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
resolve([Constants getConstants]);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/adapters/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface NavigationConstants {

export class Constants {
static async get(): Promise<NavigationConstants> {
const constants: NavigationConstants = await NativeModules.RNNBridgeModule.getConstants();
const constants: NavigationConstants = await NativeModules.RNNBridgeModule.getNavigationConstants();
return new Constants(constants);
}

Expand Down

0 comments on commit 5e6d6fc

Please sign in to comment.