我正在尝试遍历数据源并基于该数据源显示Tabs
,而我正在为此使用flatList
<Tabs
renderTabBar={() => <Scrollabletab />}
tabBarUnderlinestyle={{backgroundColor: "#4285f4"}}
tabBarBackgroundColor="#fff"
>
<flatList
data={this.state.dataSource}
renderItem={({item}) =>
<Tab
heading={item.title}
>
<Text>Tab details</Text>
</Tab>
/>
</Tabs>
这总是给我一个错误的说法
undefined is not an object (evaluating 'child.props.heading.props') the error is located at ScrollabletabView
我不知道我尝试使用map
而不是flatList
出了什么问题,并且效果很好