Console Error
Each child in a list should have a unique "key" prop.
Check the render method of CopilotModal. See https://react.dev/link/warning-keys for more information.
1 messages · Page 1 of 1 (latest)
Console Error
Each child in a list should have a unique "key" prop.
Check the render method of CopilotModal. See https://react.dev/link/warning-keys for more information.
Is this the infamous useCopilotChatSuggestions bug?
This solution has been AI generated
You’re seeing this because CopilotModal ends up rendering your children as an array, and some elements don’t have stable React keys. Wrap multiple children in a single container or provide unique keys when rendering arrays.
CopilotModal (and wrappers like CopilotSidebar/CopilotPopup) renders your children alongside its internal UI inside a Fragment. If your children are multiple elements or an array, React expects each child to have a unique key.
// Internal pattern (simplified)
<>
{children} // if this is an array, each item must have a key
<div className="copilot-ui" />
</>
// ✅ No keys needed
<CopilotSidebar>
<div>
<MyHeader />
<MyContent />
</div>
</CopilotSidebar>
// ✅ Keys added when mapping
<CopilotSidebar>
{sections.map((s) => (
<Section key={s.id} {...s} />
))}
</CopilotSidebar>
<CopilotModal>
{[
<MyHeader key="header" />,
<MyContent key="content" />
]}
</CopilotModal>
Was this helpful?
If this solution worked for you, please click on the appropriate option below to help us improve: