Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: add key prop to PathComponent map iteration (#820)

Devin687731f645fb
diff --git a/src/components/features/chat/path-component.tsx b/src/components/features/chat/path-component.tsx
index e431bb900a..febc792dda 100644
--- a/src/components/features/chat/path-component.tsx
+++ b/src/components/features/chat/path-component.tsx
@@ -72,8 +72,12 @@ function PathComponent(props: { children?: ReactNode }) {
};
if (Array.isArray(children)) {
- const processedChildren = children.map((child) =>
- typeof child === "string" ? processPath(child) : child,
+ const processedChildren = children.map((child, index) =>
+ typeof child === "string" ? (
+ <span key={`${child}-${index}`}>{processPath(child)}</span>
+ ) : (
+ child
+ ),
);
return <strong className="font-mono">{processedChildren}</strong>;