【问题标题】:undefined is not an object (evaluating 'UIManager.AndroidTextInput.Constants')undefined 不是一个对象(评估 'UIManager.AndroidTextInput.Constants')
【发布时间】:2017-04-29 15:16:02
【问题描述】:

我目前正在使用 react-native 开发 Android 和 iOS 版本,但在 iOS 版本上出现以下错误:

undefined 不是一个对象(评估 'UIManager.AndroidTextInput.Constants')

【问题讨论】:

    标签: ios react-native react-native-android react-native-ios react-modal


    【解决方案1】:

    ...基本上,有一个糟糕的平等检查器:

    if (Platform.OS = 'android') { ...

    componentDidMount() {  
        if (Platform.OS === 'android') {
                BackAndroid.addEventListener('hardwareBackPress', this.handleBackOnOverlay);
        }
    

    这导致为 iOS 应用中的 android 后退按钮添加事件侦听器。似乎因此而显示了上述错误。永远不要假设错误消息就是这样的错误。

    【讨论】:

      猜你喜欢
      • 2021-12-15
      • 2019-02-04
      • 1970-01-01
      • 2022-09-23
      • 2022-09-22
      • 1970-01-01
      • 2018-11-12
      • 2020-04-30
      • 1970-01-01
      相关资源
      最近更新 更多