mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: ensure unique keys for map features by including index in key prop
This commit is contained in:
parent
8bb5ea0cf7
commit
29b545706e
@ -56,14 +56,14 @@ export function InteractiveMap({
|
|||||||
fill="transparent"
|
fill="transparent"
|
||||||
onMouseEnter={() => setTooltipData(null)}
|
onMouseEnter={() => setTooltipData(null)}
|
||||||
/>
|
/>
|
||||||
{filteredFeatures.map((feature) => {
|
{filteredFeatures.map((feature, index) => {
|
||||||
const isHighlighted = countries.includes(feature.properties.iso_a2_eh)
|
const isHighlighted = countries.includes(feature.properties.iso_a2_eh)
|
||||||
|
|
||||||
const serverCount = serverCounts[feature.properties.iso_a2_eh] || 0
|
const serverCount = serverCounts[feature.properties.iso_a2_eh] || 0
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<path
|
<path
|
||||||
key={feature.properties.iso_a2_eh}
|
key={feature.properties.iso_a2_eh + String(index)}
|
||||||
d={path(feature) || ""}
|
d={path(feature) || ""}
|
||||||
className={
|
className={
|
||||||
isHighlighted
|
isHighlighted
|
||||||
|
Loading…
Reference in New Issue
Block a user