1.在使用FlatList的时候 missing keys for items
警告:
VirtualizedList: missing keys for items, make sure to specify a key property on each item or provide a custom keyExtractor.
方法:
_extraUniqueKey =(item ,index) => { return "index"+index+item; }
<FlatList keyExtractor = {this._extraUniqueKey}/>
2.npm start 启动服务的时候,遇到 This is probably not a problem with npm. There is likely additional logging output above
解决方法:
更新npm:
执行: npm update 再执行: yarn
3.Error:Metro Bundler can't listen on port 8081
解决办法:kill 占用8081端口的其他应用
1.找到占用端口的应用
$ sudo lsof -i :8081
2.kill (40247 是应用的 PID)
kill -9 40247
3.重新启动8081即可
4.Flatlist出现不显示的现象,只有滚动一下才显示(这个问题很无语)
解决办法:
removeClippedSubviews={false}