TabBarIOS.Item报错react.children.only expected to receive a single react element child

使用TabBarIOS.Item,报错如下:

react.children.only expected to receive a single react element child
TabBarIOS.Item报错react.children.only expected to receive a single react element child_第1张图片
报错截图

代码如下:

this.setState({selectedItem:'page-4'})}>

报错原因:

TabBarIOS.Item组件必须包含子元素,且子元素必须是一个组件

代码修正如下:

this.setState({selectedItem:'page-4'})}>
        
            Page-4
        

你可能感兴趣的:(TabBarIOS.Item报错react.children.only expected to receive a single react element child)