Fix incorrect warning on NativeEventEmitter when nativeModule is null

Summary: Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D27881851

fbshipit-source-id: 3b1cba618a86aff1e1c7ffbc0ea5d7047713d30a
This commit is contained in:
Rubén Norte
2021-04-20 08:45:42 -07:00
committed by Facebook GitHub Bot
parent de318cd318
commit 158e17f6a0
+1 -1
View File
@@ -54,7 +54,7 @@ export default class NativeEventEmitter<TEventToArgsMap: {...}>
if (nativeModule && hasAddListener && hasRemoveListeners) {
this._nativeModule = nativeModule;
} else {
} else if (nativeModule != null) {
if (!hasAddListener) {
console.warn(
'`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.',