generated from nhcarrigan/template
fix: use item name as key for equipped items list
item.type only has three possible values (weapon/armour/trinket). Using it as a React key is safe in practice because the equipment system enforces one item per slot, but item.name is a stable, semantically correct unique identifier that does not rely on that invariant.
This commit is contained in:
@@ -243,7 +243,7 @@ const CharacterPage = ({ discordId }: CharacterPageProperties): JSX.Element => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="character-page-equipment-item"
|
className="character-page-equipment-item"
|
||||||
key={item.type}
|
key={item.name}
|
||||||
>
|
>
|
||||||
<div className="character-page-equipment-header">
|
<div className="character-page-equipment-header">
|
||||||
<span className="character-page-equipment-slot">
|
<span className="character-page-equipment-slot">
|
||||||
|
|||||||
Reference in New Issue
Block a user