[react]控制台报错Each child in a list should have a unique “key“ prop.Check the render method of ‘NavBar‘

无list元素时,控制台报错NavBar组件没有单独的键值key
[react]控制台报错Each child in a list should have a unique “key“ prop.Check the render method of ‘NavBar‘_第1张图片
给NavBar中的a标签加上单独的键值即可,如下所示:

{
   
                    this.props.isdetail? 
                    <NavBar
                    mode="light"
                    icon={
   <Icon type="left" />}
                    onLeftClick={
   ()=>window

你可能感兴趣的:(react前端,javascript,es6,react)