react-native-page-scrollview
react-native-page-scrollview copied to clipboard
Invariant Violation: [657,"RCTView",81,{"width":"<<NaN>>","height":0,"backgroundColor":0}] is not usable as a native method argument
有截图但是好像我这边预览不到,提交下代码
render() {
let imgArr = [
{
uri:
'https://img.xyj321.com/attatch/2020061510_bc7597875cb6444d2131d23f5e7fde39.jpg',
},
];
return (
<PageScrollView
style={{width: deviceDpWidth, height: (deviceDpWidth / 16) * 9}}
builtinStyle="sizeChangeMode"
builtinWH={{width: 300, height: (300 / 16) * 9}}
imageArr={imgArr}
/>)}
"react": "16.9.0",
"react-native": "0.61.4",
不管什么样式都是这个问题,直接copy的代码还是这个错误;设置没设置builtinWH,style都是一样的问题
我也遇到了同样的问题,请问你解决了吗?
一样遇到这个问题
我通过修改node_module/react-native-page-scrollwiew/PageScrollView.js下解决了ios端的这个报错
- 325行修改为: arr.push(<View key={-2} style={{width:isNaN((viewWidth-width)/2)?0:(viewWidth-width)/2,height:viewHeight,backgroundColor:'#0000'}}/>);
- 377行修改为: arr.push(<View key={-3} style={{width:isNaN((viewWidth-width)/2)?0:(viewWidth-width)/2,height:viewHeight,backgroundColor:'#0000'}}/>);
我用的是横向排列,估计纵向排列依然是这问题,把对应报错的位置用isNaN判断下