Skip to content

Commit

Permalink
chore(dashboard): Fix missing React key errors (#22266)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyml authored Nov 30, 2022
1 parent 969c963 commit 4657250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const FilterControls: FC<FilterControlsProps> = ({
const renderer = useCallback(
({ id }: Filter | Divider) => {
const index = filtersWithValues.findIndex(f => f.id === id);
return <OutPortal node={portalNodes[index]} inView />;
return <OutPortal key={id} node={portalNodes[index]} inView />;
},
[filtersWithValues, portalNodes],
);
Expand Down Expand Up @@ -207,7 +207,7 @@ const FilterControls: FC<FilterControlsProps> = ({
{portalNodes
.filter((node, index) => filterIds.has(filtersWithValues[index].id))
.map((node, index) => (
<InPortal node={node}>
<InPortal node={node} key={filtersWithValues[index].id}>
{filterControlFactory(
index,
filterBarOrientation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export const ScopeRow = React.memo(({ filter }: FilterCardRowProps) => {
? Object.values(scope)
.flat()
.map((element, index) => (
<span>{index === 0 ? element : `, ${element}`}</span>
<span key={element}>
{index === 0 ? element : `, ${element}`}
</span>
))
: t('None')}
</RowValue>
Expand Down

0 comments on commit 4657250

Please sign in to comment.