ios - 不支持的顶级事件类型“在 iphone X 中调度的 onGestureHandlerStateChange

标签 ios react-native react-navigation react-native-ios react-navigation-drawer

我在 react-navigation-drawer 中遇到问题。

"react-native-gesture-handler": "^1.0.16",
"react-navigation": "^3.3.2"

安装了这两个版本。抽屉在 Android 和 iPhone 5S 中正常工作。但是,当我在 iPhone X 上运行该应用程序时,当我通过手势打开抽屉时会抛出错误。

Unsupported top level event type "onGestureHandlerStateChange" dispatched

最佳答案

来自这个react-native-gesture-handler issue comment通过 balthazar :

Because my navigators were created asynchronously, the handler was registered too late and thus throwing this error. I fixed the issue by simply doing:

import 'react-native-gesture-handler';

at the top of my index.js 🙂

通过 index.js,balthazar 指的是您应用程序的入口点——但我想重要的是它是在您第一次使用 react-native-gesture-handler 之前导入的

关于ios - 不支持的顶级事件类型“在 iphone X 中调度的 onGestureHandlerStateChange,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54923622/

相关文章:

ios - 使用照片框架从照片库中删除照片

ios - 我在我的项目中使用 Camera API 和 QRCode API,我可以在我的项目中实现多任务处理(splitvIew)吗

regex - 正则表达式的重构起点

reactjs - 有条件的动画组件很卡顿

react native 'react-native-html-to-pdf' 警告

javascript - 如何使用 React Native Navigation (v5) 向父页面发送数据?

ios - 从 AVFullScreenViewController iOS 8 获取媒体链接

ios - Swift - 尝试将 Realm 对象列表(已保存到 Realm )转换为结果时出错

javascript - React( native )导航切换搜索栏

react-native - 使用内容组件进度 react 抽屉导航