@react-navigation/drawer 5.x or 6.x 遇到的坑

@react-navigation/drawer 6.x 遇到

React Native Drawer - Cannot read Property "isConfigured" of undefined & [Reanimated] Failed to create a worklet

ERROR TypeError: Cannot read property 'isConfigured' of undefine

解决的方案:

1、升级

"@react-navigation/drawer": "6.6.13",

    "@react-navigation/native": "6.1.16",

    "@react-navigation/stack": "6.3.28",

2、设置 babel.config

module.exports = {

...........

  plugins: ['react-native-reanimated/plugin'], //新增

};

3、删除 node_modules 等相关

4、第一次执行 yarn start --reset-cache

然后就成功了。


另外 @react-navigation/drawer 5.x 有一个错误是ERROR TypeError: Cannot read property 'prototype' of undefined, js engine: hermes,直接升级,到6.x

注意同时升级其他相关库

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容