chore(dashboard): Fix missing React key errors (#22266)

This commit is contained in:
Cody Leff 2022-11-30 05:36:16 -07:00 committed by GitHub
parent 969c9634f6
commit 4657250bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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],
);
@ -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,

View File

@ -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>