React-Native 遇到的坑

1、错误日志:Warning: Failed child context type: Invalid child context virtualizedCell.cellKey of type number supplied to CellRenderer, expected string.
这个错误是在使用 RN官网推出最新的列表组件 FlatList 是出现的红色警告,出现这个错误能够正常运行,就是每次调试时看到它总以为怪怪的,因此就查资料处理了,下面给出解决方案:this

解决示例代码片断:spa

<FlatList
style={myStyle.newsList}
ref={(flatList)=>this._flatList = flatList}
ItemSeparatorComponent={this._separator}
renderItem={this._renderItem}
keyExtractor={(item, index) => index.toString()}
data={data}>
</FlatList>

调试