Error while updating property 'height' in shadow node of type: RCTView

1.问题背景描述:

reactNative 中编译项目时突然报错,具体如图:
这里写图片描述

2.问题原因:

在reactNative 写样式的时候  宽、高、padding等值不能是字符串,正如上图中黄色框中的‘heigth’XXX,下方是代码。
    header: {
        width: 66,
        height: '24',
    },

3.解决方案:

将样式中的值改成数字即可。
    header: {
        width: 66,
        height: 24,
    },

猜你喜欢

转载自blog.csdn.net/li11_/article/details/80094738
今日推荐