Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用 react-native 开发 Android 和 iOS 版本,但在 iOS 版本上出现以下错误:
undefined 不是一个对象(评估 'UIManager.AndroidTextInput.Constants')
...基本上,有一个糟糕的平等检查器:
if (Platform.OS = 'android') { ...
为了
componentDidMount() { if (Platform.OS === 'android') { BackAndroid.addEventListener('hardwareBackPress', this.handleBackOnOverlay); }
这导致为 iOS 应用程序中的 android 后退按钮添加了事件侦听器。似乎因此而显示了上述错误。永远不要假设错误消息就是这样的错误。