鍍金池/ 問答/HTML5  數(shù)據(jù)庫  HTML/ react報(bào)錯(cuò)求解!

react報(bào)錯(cuò)求解!

Warning: Encountered two children with the same key, `.$4`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
    in ul (created by DOMWrap)
    in DOMWrap (created by Menu)
    in Provider (created by Menu)
    in Menu (created by Menu)
    in Menu (created by Left)
    in div (created by Sider)
    in div (created by Sider)
    in Sider (created by Left)
    in Left (created by Main)
    in div (created by BasicLayout)
    in BasicLayout (created by Adapter)
    in Adapter (created by Main)
    in Main (created by Connect(Main))
    in Connect(Main) (created by Route)
    in Route
    in Switch
    in Router
    in Provider
    in Unknown
    
    
    以上為react錯(cuò)誤代碼,求解!    
    
    
   問題以解決  把Key的值修改下就可以了    
回答
編輯回答
愿如初

你用了同一個(gè)key:‘.$4’,key是標(biāo)識(shí),不能重復(fù)

2017年12月6日 11:14
編輯回答
柚稚

看到類似很多的問題,為什么不讀這些信息呢?是英文看不懂,還是什么原因呢。
我英語體育老師教的,也能猜個(gè)大概。

2017年10月7日 04:06
編輯回答
晚風(fēng)眠

這是warning不是error,原因來自于你遍歷渲染了一個(gè)數(shù)組的元素,然后有元素的key是相同的。

2018年6月21日 15:49