Skip to content

Commit

Permalink
Addon Interactions: Use unique keys when rendering array nodes in panel
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jul 2, 2024
1 parent 6476483 commit d0ab771
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/addons/interactions/src/components/MethodCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ export const ArrayNode = ({
}
const nodes = value
.slice(0, 3)
.map((v) => <Node key={JSON.stringify(v)} value={v} nested callsById={callsById} />);
.map((v, index) => (
<Node key={`${index}--${JSON.stringify(v)}`} value={v} nested callsById={callsById} />
));
const nodelist = interleave(nodes, <span>, </span>);
if (value.length <= 3) {
return <span style={{ color: colors.base }}>[{nodelist}]</span>;
Expand Down

0 comments on commit d0ab771

Please sign in to comment.