mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update NativeModule documentation to show correct event emitter usage
It looks like in the various changes to native module events, the documentation has become a little confused. As far as I can tell, if you use `sendAppEventWithName` then the `NativeAppEventEmitter` is used and if `sendDeviceEventWithName` then it should be `DeviceEventEmitter`.
This commit is contained in:
1 parent
fe2155e238
commit
b13e2e8c2e
1 file changed
+2
-2
@@ -256,9 +256,9 @@ The native module can signal events to JavaScript without being invoked directly
|
||||
JavaScript code can subscribe to these events:
|
||||
|
||||
```javascript
|
||||
var { DeviceEventEmitter } = require('react-native');
|
||||
var { NativeAppEventEmitter } = require('react-native');
|
||||
|
||||
var subscription = DeviceEventEmitter.addListener(
|
||||
var subscription = NativeAppEventEmitter.addListener(
|
||||
'EventReminder',
|
||||
(reminder) => console.log(reminder.name)
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user