Skip to content

Commit b71abc4

Browse files
author
Akos Kitta
committed
fix: not unique key in react element
include port protocol and FQBN in key calculation. Signed-off-by: Akos Kitta <[email protected]>
1 parent d0bf33f commit b71abc4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arduino-ide-extension/src/browser/boards/boards-toolbar-item.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,12 @@ export class BoardListDropDown extends React.Component<BoardsDropDown.Props> {
135135
onDefaultAction();
136136
}
137137
};
138+
const boardListItemKey = `${boardLabel}${
139+
boardFqbn ? `-${boardFqbn}` : ''
140+
}-${port.protocol}-${port.address}`;
138141
return (
139142
<div
140-
key={`board-item--${boardLabel}-${port.address}`}
143+
key={`board-item--${boardListItemKey}`}
141144
className={classNames('arduino-boards-dropdown-item', {
142145
'arduino-boards-dropdown-item--selected': selected,
143146
})}

0 commit comments

Comments
 (0)