mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08: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:
@@ -256,9 +256,9 @@ The native module can signal events to JavaScript without being invoked directly
|
|||||||
JavaScript code can subscribe to these events:
|
JavaScript code can subscribe to these events:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var { DeviceEventEmitter } = require('react-native');
|
var { NativeAppEventEmitter } = require('react-native');
|
||||||
|
|
||||||
var subscription = DeviceEventEmitter.addListener(
|
var subscription = NativeAppEventEmitter.addListener(
|
||||||
'EventReminder',
|
'EventReminder',
|
||||||
(reminder) => console.log(reminder.name)
|
(reminder) => console.log(reminder.name)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user