Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

React Native warns: new NativeEventEmitter() was called without the required addListener method

Error`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.

Short answer

React Native logs this when you pass a non-null object to new NativeEventEmitter() and that object has no addListener function (or no removeListeners function). Pass the real native module, and make your own iOS module extend RCTEventEmitter so it provides those methods.

  • Applies to React Native 0.7x-0.8x, iOS, Xcode 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find every place that creates an emitter and see what it passes in.

    grep -rn "new NativeEventEmitter" src app App.tsx node_modules/<library-name>/ 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1The emitter wraps your module, and the module is a plain RCTBridgeModuleYour own iOS native module does not subclass RCTEventEmitterFix
    2. 2The code passes a JavaScript wrapper, a plain object, or a library export instead of the module itselfThe argument is not the native moduleFix

What does the error look like?

  • `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
  • `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

Cause 1 of 2

Your own iOS native module does not subclass RCTEventEmitter

1Check

React Native's source warns only when the module you pass lacks the function, so a module that cannot emit events triggers it. The iOS native modules guide says the preferred way to send events is to subclass RCTEventEmitter.

grep -rn "RCTEventEmitter\|RCT_EXPORT_MODULE" ios/

2Fix

Make the module subclass RCTEventEmitter, as in the guide's header, and implement supportedEvents. RCTEventEmitter is the documented base class for modules that send events to JavaScript.

//  CalendarModule.h
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

@interface CalendarModule : RCTEventEmitter <RCTBridgeModule>
@end

3Verify

Rebuild the iOS app. Create the emitter with the module and confirm the warning is gone.

import { NativeEventEmitter, NativeModules } from 'react-native';
const emitter = new NativeEventEmitter(NativeModules.CalendarModule);

Confirmed by reactnative.dev

Did this fix it?

Cause 2 of 2

The argument is not the native module

1Check

The warning fires for any non-null argument that is missing the methods. A wrapper object you wrote yourself has none.

grep -rn "new NativeEventEmitter(" src app 2>/dev/null
grep -rn "NativeModules\." src app 2>/dev/null

2Fix

Pass the native module you got from NativeModules, or from the library's documented export, and do not pass a wrapper.

const { CalendarModule } = NativeModules;
const emitter = new NativeEventEmitter(CalendarModule);

3Verify

Reload the app and watch the console: neither warning shows.

npx react-native start --reset-cache

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Build event-emitting iOS modules from RCTEventEmitter from the start.
  • Pass the exact native module object to NativeEventEmitter, not a wrapper.
  • Keep one emitter per native module instead of creating new ones in every component.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.