Skip to content

Commit f327967

Browse files
committed
fix: avoid key warning from react in Ask component
1 parent 37738b0 commit f327967

File tree

1 file changed

+10
-2
lines changed
  • plugins/plugin-codeflare/src/components

1 file changed

+10
-2
lines changed

Diff for: plugins/plugin-codeflare/src/components/Ask.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,18 @@ export default class AskUI extends React.PureComponent<Props, State> {
262262
// due to the filtering, or the lack of a prior choice
263263
return [
264264
...(suggested && (!filter || pattern.test(suggested.message))
265-
? [<SelectGroup label="Prior choice">{this._selectOptionForChoice(suggested, true)}</SelectGroup>]
265+
? [
266+
<SelectGroup key="prior" label="Prior choice">
267+
{this._selectOptionForChoice(suggested, true)}
268+
</SelectGroup>,
269+
]
266270
: []),
267271
...(others.length > 0
268-
? [<SelectGroup label={suggested ? "Other choices" : "Choices"}>{others}</SelectGroup>]
272+
? [
273+
<SelectGroup key="other" label={suggested ? "Other choices" : "Choices"}>
274+
{others}
275+
</SelectGroup>,
276+
]
269277
: []),
270278
]
271279
}

0 commit comments

Comments
 (0)