Closed jolly-wu closed 5 years ago
经过测试最新版本,并没有你说的问题,具体怎么复现呢?
确实有这个问题的。 华为mete20pro,android 9。
"beeshell": "^2.0.11",
"react": "16.6.3",
"react-native": "0.57.8",
Calendar/index.js
Line: 170
backgroundColor: desc.selected ? variables.mtdBrandPrimary : (desc.today ? variables.mtdFillBody : null)
backgroundColor
的值会得到null
这时就是会报出这个错误,导致程序奔溃。
把null
改成空串就不会报错了。
@wxlworkhard
我目前的解决方案是 继承 Calendar
组件 重写 renderItem
方法 ,什么都没改动 然后就好了。
我不确定问题出在哪里。 @wxlworkhard 你可以检查一下吗?
发现个问题,下面这个null赋值会导致崩溃: Calender的index.js的renderItem (item, date, desc) { return React.createElement( View, { style: [ styles.gridItem, { backgroundColor: desc.selected ? variables.mtdBrandPrimary : desc.today ? variables.mtdFillBody : null } ] },