我使用的是Primereact的日历组件.我有一个props
numberOfMonths={18}
个
给我18个月/专栏.这样做的问题是,它在12个月之后每隔一个月使用相同的子元素键生成一次,所以我收到了一堆这样的错误:
Warning: Encountered two children with the same key, `8`. Keys should be unique so that components maintain their identity across updates.....
有什么办法可以让Primereact用唯一的密钥生成额外的月份吗?谢谢.
这是我的带有props 的完整组件的外观:
<Calendar value={dates} onChange={(e : CalendarChangeEvent) => verticalDateHandler(e.value)}numberOfMonths={18} minDate={today} selectionMode="range" dateFormat="YYYY MMM DD" touchUI inline viewDate={today}/>
try 删除"TouchUI",try 删除view Dateprops ,try 使用额外的月份名称更新Locale.没有骰子.