react native开发遇到的问题一

2022-04-01 09:04:44

其实最大的问题是ractnative更新速度太快了,并且兼容性不大,包括周边库。

教程更是差距很大

安装这些库

"@react-navigation/drawer": "6.1.3",
"@react-navigation/native": "^6.0.8",
"@react-navigation/stack": "^6.1.1",

按照demo来,会出错,因为你还要安装其他库,你的程序报错会提醒你要安装那些库。

使用

react-navigation/drawer

会报错,说是否配置了

react-native-reanimated

的babel配置文件,还是要好好看文档吧,官方正式文档哦,会让我们去设置react-native-reanimated的一些配置。

里面包括设置安卓原生代码,和配置babel.config.js,具体怎么配置,我就不多讲了,只讲思路,因为文档一直在变,我讲了也不一定适用你。


继续运行,还是报错,结局办法,情况metro缓存,这样运行 npm run start  --reset-cache 我直接修改了package.json的start 语句,在后面添加了 --reset-cache 每次运行都情况缓存。


上面遇到的问题解决思路。

  1. 仔细阅读最新的官方文档

  2. 情况缓存继续运行。

  3. 实在不行,重新跑下安卓编译

  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

  • 2017-11-19 00:17:51

    Java如何获取Date的“昨天”与“明天”示例代码

    最近在做项目的时候用到Date和Calendar比较多,而且用到的方式也比较全,突然想到一个问题,Java如何获取Date的"昨天"与"明天",也就是前一天和后一天呢?思考后写出了方法,想着万一以后用到,就总结出来,也方便有需要的朋友们参考借鉴,下面来一起看看吧。

  • 2017-11-23 02:00:51

    js 分页插件twbs-pagination

    ​cdn地址 http://www.bootcdn.cn/twbs-pagination/ 官网地址 可以在cdn地址上面查看到