Skip to content

Commit c7d98ef

Browse files
committed
stable and unique key for /rules page and key fixes
Signed-off-by: amanycodes <amanycodes@gmail.com>
1 parent dc1b95b commit c7d98ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/ui/mantine-ui/src/pages/AlertsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export default function AlertsPage() {
220220
shadow="xs"
221221
withBorder
222222
p="md"
223-
key={`${g.name}-${g.file}`} // TODO: Find a stable and definitely unique key.
223+
key={`${g.file}-${g.name}`} // TODO: Find a stable and definitely unique key.
224224
>
225225
<Group mb="md" mt="xs" ml="xs" justify="space-between">
226226
<Group align="baseline">

web/ui/mantine-ui/src/pages/RulesPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ export default function RulesPage() {
8686
(effectiveActivePage - 1) * ruleGroupsPerPage,
8787
effectiveActivePage * ruleGroupsPerPage
8888
)
89-
.map((g, i) => (
89+
.map((g) => (
9090
<Card
9191
shadow="xs"
9292
withBorder
9393
p="md"
9494
mb="md"
95-
key={i} // TODO: Find a stable and definitely unique key.
95+
key={`${g.file}-${g.name}`} // TODO: Find a stable and definitely unique key.
9696
>
9797
<Group mb="md" mt="xs" ml="xs" justify="space-between">
9898
<Group align="baseline">

0 commit comments

Comments
 (0)