简体   繁体   English

undefined不是对象(评估'_reactNative.BackHandler.addEventListener')

[英]undefined is not an object (evaluating '_reactNative.BackHandler.addEventListener')

I am using react-native: 0.40 with react: 15.4.2 and react-native-router-flux: 3.37.0 and I've been getting this error. 我正在使用react-native:0.40 with react:15.4.2和react-native-router-flux:3.37.0并且我一直在收到此错误。 Although everything I get this error on iOS, the app runs with no issue. 虽然我在iOS上遇到此错误,但该应用程序运行时没有任何问题。 But on Android, whenever I press the back button, the app crashes. 但在Android上,每当我按下后退按钮时,应用程序都会崩溃。

My assumption is that react native back button is conflicting with react-native-router-flux package. 我的假设是本机后退按钮与react-native-router-flux包冲突。

Any help would be appreciated. 任何帮助,将不胜感激。

evaluating '_reactNative.BackHandler.addEventListener' 评估'_reactNative.BackHandler.addEventListener'

Try react-native@0.44.0 and react@16.0.0-alpha.6. 请尝试react-native@0.44.0和react@16.0.0-alpha.6。 I believe that this was fixed here: https://github.com/aksonov/react-native-router-flux/pull/1819 我相信这是在这里修复的: https//github.com/aksonov/react-native-router-flux/pull/1819

I had the same error and after installing the above versions it works for me. 我有同样的错误,安装上述版本后,它适用于我。

Make sure you are importing BankHandler from react-native and not react, it should be 确保你从react-native导入BankHandler并且没有反应,它应该是

import { BackHandler } from 'react-native';

NOT

import { BackHandler } from 'react';

That was what caused the error for me :) 这就是导致我错误的原因:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未定义不是对象(评估'_reactNative.Nativemodules.UIManager.RCTVideo.Constants') - Undefined is not an object (evaluating '_reactNative.Nativemodules.UIManager.RCTVideo.Constants') "react-native-video 未定义不是一个对象(评估'_reactNative ...)" - react-native-video Undefined is not an object (evaluating '_reactNative ...) undefined 不是对象(评估'_reactNative.PropTypes.string')错误 - undefined is not an object (evaluating '_reactNative.PropTypes.string') Error 在将本机版本更新到 0.59.4 后,undefined 不是评估 (_reactnative.Modal.propTypes.animationType) 的对象 - undefined is not an object evaluating (_reactnative.Modal.propTypes.animationType) after updating react native version to 0.59.4 Undefined不是this.state中的对象 - ReactNative - Undefined is not a object in this.state - ReactNative 未定义不是对象(评估'Sn [e]') - Undefined is not an object (evaluating 'Sn[e]') 'undefined不是一个对象(评估'props.deviceLocale') - 'undefined is not an object (evaluating 'props.deviceLocale') 未定义不是对象(评估“ props.item.txt”) - Undefined is not an object (evaluating 'props.item.txt') undefined 不是一个对象(评估'_reactNativeContacts.default.getAll') - undefined is not an object (evaluating '_reactNativeContacts.default.getAll') 未定义不是对象(评估this.props.navigator.push') - Undefined is not an object( evaluating this.props.navigator.push')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM