Skip to content

Commit ba387dc

Browse files
committed
added unique query key
1 parent f002025 commit ba387dc

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

extension/src/containers/DiffTab.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import Typography from '@mui/material/Typography';
2-
import FormGroup from '@mui/material/FormGroup';
3-
import FormControlLabel from '@mui/material/FormControlLabel';
4-
import Switch from '@mui/material/Switch';
5-
import React, { useState } from 'react';
1+
import Typography from "@mui/material/Typography";
2+
import FormGroup from "@mui/material/FormGroup";
3+
import FormControlLabel from "@mui/material/FormControlLabel";
4+
import Switch from "@mui/material/Switch";
5+
import React, { useState } from "react";
66

7-
import JsonDiff from '../components/JsonDiff';
7+
import JsonDiff from "../components/JsonDiff";
88

9-
import { DataTabProps } from '../types';
9+
import { DataTabProps } from "../types";
1010

1111
const DiffTab = ({ queryDisplay, currentIndex }: DataTabProps) => {
1212
// state to determine if unchanged are hidden or closed
@@ -22,21 +22,20 @@ const DiffTab = ({ queryDisplay, currentIndex }: DataTabProps) => {
2222
return (
2323
<>
2424
<FormControlLabel
25-
sx={{ color: 'primary.main', marginLeft: 0 }}
25+
sx={{ color: "primary.main", marginLeft: 0 }}
2626
control={
2727
<Switch checked={isHidden} onChange={toggleChangedProperties} />
2828
}
29-
label={`${isHidden ? 'Show' : 'Hide'} Unchanged Properties `}
29+
label={`${isHidden ? "Show" : "Hide"} Unchanged Properties `}
3030
/>
3131
{queryDisplay.length > 0 && queryDisplay[currentIndex] && (
32-
<div className='data'>
32+
<div className="data">
3333
{queryDisplay[currentIndex].map((queryState, i) => (
34-
<>
35-
<Typography variant='h6' sx={{ color: 'secondary.main' }}>
34+
<React.Fragment key={queryState.queryKey}>
35+
<Typography variant="h6" sx={{ color: "secondary.main" }}>
3636
{queryState.queryKey}
3737
</Typography>
3838
<JsonDiff
39-
key={queryState.queryKey}
4039
currentJson={queryState.queryData}
4140
isHidden={isHidden}
4241
oldJson={
@@ -47,7 +46,7 @@ const DiffTab = ({ queryDisplay, currentIndex }: DataTabProps) => {
4746
: null
4847
}
4948
/>
50-
</>
49+
</React.Fragment>
5150
))}
5251
</div>
5352
)}

0 commit comments

Comments
 (0)