diff --git a/Libraries/BatchedBridge/NativeModules.js b/Libraries/BatchedBridge/NativeModules.js index a916f37b3ab..df60fc87001 100644 --- a/Libraries/BatchedBridge/NativeModules.js +++ b/Libraries/BatchedBridge/NativeModules.js @@ -64,7 +64,7 @@ function genModule( Object.assign(module, constants); if (module.getConstants == null) { - module.getConstants = () => constants; + module.getConstants = () => constants || Object.freeze({}); } else { console.warn( `Unable to define method 'getConstants()' on NativeModule '${moduleName}'. NativeModule '${moduleName}' already has a constant or method called 'getConstants'. Please remove it.`,