Fixed key issue with fragment

This commit is contained in:
Mitchell McCaffrey 2020-04-26 18:33:28 +10:00
parent 9498ff9866
commit b691842a21

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef } from "react";
import React, { useState, useEffect, useRef, Fragment } from "react";
import { Flex, Box, IconButton, Label, Divider } from "theme-ui";
import SelectMapButton from "./SelectMapButton";
@ -311,10 +311,10 @@ function MapControls({
ref={expanedMenuRef}
>
{sections.map((section, index) => (
<>
<Fragment key={section.id}>
{section.component}
{index !== sections.length - 1 && <Divider />}
</>
</Fragment>
))}
</Box>
</>