mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
de318cd318
commit
158e17f6a0
@@ -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.',
|
||||
|
||||
Reference in New Issue
Block a user