React Native warns: new NativeEventEmitter() was called without the required addListener method
`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.
Fix it fast
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/null2Match what you see, then jump to its fix
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>
@end3Verify
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
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/null2Fix
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-cacheConfirmed by raw.githubusercontent.com
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Mobile apps
Running pod on a React Native project fails with can't find gem cocoapods
can't find gem cocoapods (>= 0.a) with executable pod
The pod command exists, but the Ruby that is running it has no CocoaPods gem.
3 causes, each with a fixMobile apps
Axios request works on iOS or in a browser but fails on Android with Network Error
AxiosError: Network Error
A React Native app has no CORS, so on Android a Network Error usually means the request never reached the server.
3 causes, each with a fixMobile apps
Axios returns Network Error in a React Native app on iPhone or the iOS Simulator
error.code is ERR_NETWORK and error.response is undefined
A Network Error means iOS stopped the request before any HTTP answer came back.
3 causes, each with a fixMobile apps
backgroundImage: url(...) does nothing in a React Native view
ImageBackground renders an empty area
In React Native the backgroundImage style draws linear and radial gradients, not pictures, so url(...) is ignored.
3 causes, each with a fixMobile apps
A custom font in React Native falls back to the system font
Unrecognized font family 'MyFont'
React Native does not report a missing font, it just draws the system font.
6 causes, each with a fixMobile apps
fetch fails with TypeError: Network request failed in React Native
Network request failed
Network request failed means the request never got an HTTP response, so there is no status code to read.
3 causes, each with a fix