react antd Warning: must set key for children

實例中,location 有多是一個‘’,''.split() 將輸出[""],是個含有空字符串的數組,而[]是個什麼都沒有的數組,二者不一樣。
code:
change initialValue from :
initialValue: location.split(',') || []
to:
initialValue: location === '' ? [] : location.split(',')數組

相關文章
相關標籤/搜索