Merge pull request #16044 from amanycodes/fix/stable-cardUI-key

mantine-ui: stable AND definitely unique key for /alerts cards
This commit is contained in:
Julius Volz 2025-04-24 17:44:36 +02:00 committed by GitHub
commit 9ab60c59e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -216,12 +216,12 @@ export default function AlertsPage() {
// convenient to have in the same file IMO).
const renderedPageItems = useMemo(
() =>
currentPageGroups.map((g, i) => (
currentPageGroups.map((g) => (
<Card
shadow="xs"
withBorder
p="md"
key={i} // TODO: Find a stable and definitely unique key.
key={`${g.file}-${g.name}`}
>
<Group mb="sm" justify="space-between">
<Group align="baseline">

View File

@ -86,12 +86,13 @@ export default function RulesPage() {
(effectiveActivePage - 1) * ruleGroupsPerPage,
effectiveActivePage * ruleGroupsPerPage
)
.map((g, i) => (
.map((g) => (
<Card
shadow="xs"
withBorder
p="md"
key={i} // TODO: Find a stable and definitely unique key.
mb="md"
key={`${g.file}-${g.name}`}
>
<Group mb="sm" justify="space-between">
<Group align="baseline">