react native 踩坑记

react native 碰到的几个坑。记录如下。

1.com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'n.internals.offset[e]'), stack:

updateIndex@728:3247

onScrollEnd@728:2792

<unknown>@728:4023

<unknown>@23:1787

解决办法:

更改文件   node_modules/react-native-swiper/src/index.js 398 line add
if(offset === undefined || this.internals.offset === undefined){ return; }

———————————————————

2. react-native 调试的时候会有报错:日志Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled.

reactConsoleErrorHandler @ ExceptionsManager.js:71

console.error @ YellowBox.js:61

_handleLongDelay @ Touchable.js:596

解决办法:

My practical solution was to edit react-native source code at:

node-modules/react-native/Libraries/Components/Touchable/Touchable.js

Here I've changed "console.error" to "console.log" at line 628, this way I receive the message, however my app is not interrupted and the error is "dissmissed"

3.react native 类似安卓的viewpage 轮播图片的时候,应用的控件有报错,cannot read property x of undefined react native  。android 某些机型轮播无限滚动情况。

解决办法:

node_modules/react-native-swiper/src/index.js 171 line add

更改为:autoplayTimeout: 3,

 

可以避免cannot read property x of undefined react native 这个报错,但实际上并没有完全解决有些机型比如魅族,速度超快无限轮播的情况。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值