React Native Warning Encountered two children with the same key

React Native Warning Encountered two children with the same key

通过mock的json数据生成item list列表之后时候报错
一开始以为是没有设置key,后来发现即使设置random key之后依然如此
最后查看json发现造的数据有几项数据id相同,把id改掉即可(即使没有在组件中使用源数据的id项,RN也依然认为key重复)

猜你喜欢

转载自www.cnblogs.com/ltfxy/p/12924757.html