Files
react-native/Libraries/EventEmitter/RCTEventEmitter.js
T
Lulu Wu de477a0df6 Register RCTEventEmitter as callable module for Venice
Summary:
## Context
Trying to fix this js error
```
com.facebook.errorreporting.lacrima.common.exception.LacrimaJavascriptException: Error: Module RCTEventEmitter has not been registered as callable. Did you forget to call `RN$registerCallableModule`?, js build: UNKNOWN
```
https://fburl.com/logview/fvc33d48

Changelog:
[General][Changed] - Register RCTEventEmitter as callable module for Venice

Reviewed By: PeteTheHeat

Differential Revision: D27969226

fbshipit-source-id: 8e807ee5b2ef447b0bb49fa2107352d89584c181
2021-04-23 13:32:05 -07:00

26 lines
602 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
const RCTEventEmitter = {
register(eventEmitter: any) {
if (global.RN$Bridgeless) {
global.RN$registerCallableModule('RCTEventEmitter', () => eventEmitter);
} else {
BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter);
}
},
};
module.exports = RCTEventEmitter;