Use react fragment with key property in loop

[MAILPOET-3469]
This commit is contained in:
Jan Lysý
2021-06-09 16:15:59 +02:00
committed by Veljko V
parent f3bd457c3a
commit 5035fc0f33

View File

@@ -106,7 +106,7 @@ export const Form: React.FunctionComponent<Props> = ({
</Heading> </Heading>
<ConditionType /> <ConditionType />
{Array.isArray(filterRows) && filterRows.map((filterRow, index) => ( {Array.isArray(filterRows) && filterRows.map((filterRow, index) => (
<> <React.Fragment key={filterRow.index}>
<Grid.ThreeColumns> <Grid.ThreeColumns>
{filterRows.length > 1 && ( {filterRows.length > 1 && (
<a <a
@@ -143,7 +143,7 @@ export const Form: React.FunctionComponent<Props> = ({
)} )}
</Grid.ThreeColumns> </Grid.ThreeColumns>
<FilterSeparator index={index} /> <FilterSeparator index={index} />
</> </React.Fragment>
))} ))}
<Button <Button
type="button" type="button"