mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
de477a0df6
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
26 lines
602 B
JavaScript
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;
|