找不到变量DeviceEventEmitter

时间:2019-11-08 14:27:51

标签: android react-native react-native-push-notification

我正在React-native中实现react-native-push-notification包。

在链接上的示例中:https://github.com/zo0r/react-native-push-notification#2-specify-handlers-for-the-notification-actions

显示错误:找不到变量:DeviceEventEmitter。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

您需要从'react-native'导入DeviceEventEmitter

import { DeviceEventEmitter } from 'react-native';