简体   繁体   中英

Can't find variable DeviceEventEmitter

I am implementing the react-native-push-notification package in react-native.

In the example on the link: https://github.com/zo0r/react-native-push-notification#2-specify-handlers-for-the-notification-actions .

Error is displayed: Can't find variable: DeviceEventEmitter.

What can I do?

You need to import the DeviceEventEmitter from 'react-native'

import { DeviceEventEmitter } from 'react-native';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM