gpt4 book ai didi

nivo-slider - 警告 : Encountered two children with the same key

转载 作者:行者123 更新时间:2023-12-05 03:06:04 33 4
gpt4 key购买 nike

我正在使用 nivo line 组件绘制堆积线图。我收到此错误:

Warning: Encountered two children with the same key, `L1.87.83999837239584`. 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

它在谈论什么键和 child ?图表上的每个数据点是否有可能是一个不同的 React 元素,它是某个集合的一部分并且必须在“ react 意义”中唯一标识?

最佳答案

显然,Nivo 获取了您的 x,y 数据对,并将每对值组合成用于集合中标识的 react 键。这意味着如果你有一个重复的 x,y 对,你最终会得到一个重复的键,这会导致我报告的错误。它还会因具有 2 个相同的 x 值和不同的 y 值而爆炸——不知道如何处理。

关于nivo-slider - 警告 : Encountered two children with the same key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50029158/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com