Ajoute des key au map

pull/2092/head
Jérémy Rialland 2022-04-05 09:52:47 +02:00 committed by Johan Girod
parent 21efc50125
commit 60a0ca68a5
2 changed files with 4 additions and 6 deletions

View File

@ -155,8 +155,6 @@ export function useButtonOrLink(
)
)
console.log(initialProps)
const buttonOrLinkProps = {
...initialProps,
...buttonProps,

View File

@ -18,7 +18,7 @@ import { getMeta } from '@/utils'
import { Grid } from '@mui/material'
import { Item } from '@react-stately/collections'
import { Rule, RuleNode } from 'publicodes'
import { useContext, useEffect, useMemo, useState } from 'react'
import { Fragment, useContext, useEffect, useMemo, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import styled, { css } from 'styled-components'
import { SimpleField } from '../_components/Fields'
@ -322,7 +322,7 @@ function ResultSection() {
>
{fields.map(([dottedName, rule]) =>
getMeta<Meta>(rule.rawNode, {})?.section === 'oui' ? (
<Grid xs={12}>
<Grid item xs={12} key={dottedName}>
{rule.dottedName.split(' . ').length === 3 ? (
<H3>{rule.title}</H3>
) : (
@ -336,7 +336,7 @@ function ResultSection() {
)}
</Grid>
) : (
<>
<Fragment key={dottedName}>
<Grid item xs={12} sm={8} md={9}>
<Body>
{rule.title} <em>{rule.rawNode.note}</em>
@ -350,7 +350,7 @@ function ResultSection() {
</StyledCase>
</Body>
</Grid>
</>
</Fragment>
)
)}
</Grid>