Skip to content

Commit

Permalink
Register RCTEventEmitter as callable module for Venice
Browse files Browse the repository at this point in the history
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
  • Loading branch information
luluwu2032 authored and facebook-github-bot committed Apr 23, 2021
1 parent 23ae702 commit de477a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/EventEmitter/RCTEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const BatchedBridge = require('../BatchedBridge/BatchedBridge');

const RCTEventEmitter = {
register(eventEmitter: any) {
BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter);
if (global.RN$Bridgeless) {
global.RN$registerCallableModule('RCTEventEmitter', () => eventEmitter);
} else {
BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter);
}
},
};

Expand Down

0 comments on commit de477a0

Please sign in to comment.