Skip to content

Commit

Permalink
output: fix unique key error (eclipse-theia#11922)
Browse files Browse the repository at this point in the history
The commit fixes the react "unique key" error for the output channel selector.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto authored Nov 25, 2022
1 parent 4f46701 commit 32deea2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/output/src/browser/output-toolbar-contribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class OutputToolbarContribution implements TabBarToolbarContribution {
}

protected readonly NONE = '<no channels>';
protected readonly OUTPUT_CHANNEL_LIST_ID = 'outputChannelList';

protected renderChannelSelector(): React.ReactNode {
const channelOptionElements: SelectOption[] = [];
Expand All @@ -96,7 +97,7 @@ export class OutputToolbarContribution implements TabBarToolbarContribution {
value: this.NONE
});
}
return <div id='outputChannelList'>
return <div id={this.OUTPUT_CHANNEL_LIST_ID} key={this.OUTPUT_CHANNEL_LIST_ID}>
<SelectComponent
key={this.outputChannelManager.selectedChannel?.name}
options={channelOptionElements}
Expand Down

0 comments on commit 32deea2

Please sign in to comment.