1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-27 13:49:10 +02:00

fix react key issue

This commit is contained in:
Tymoteusz Czech 2025-07-01 16:26:31 +02:00
parent 400d3ce2a2
commit 75d3a5d8d6
No known key found for this signature in database
GPG Key ID: 133555230D88D75F
2 changed files with 15 additions and 14 deletions

View File

@ -25,7 +25,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
onChange={(_, newValue) => onChange(newValue?.name || '')}
disabled={loading}
renderOption={(props, option, { inputValue }) => (
<Box component='li' {...props}>
<Box component='li' {...props} key={option.name}>
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<Typography variant='body2'>
<Highlighter search={inputValue}>

View File

@ -63,21 +63,22 @@ export const useUrlState = () => {
)
: 0;
const newLayoutItem: LayoutItem = {
i: newChart.id,
x: 0,
y: maxY,
w: 6,
h: 4,
minW: 4,
minH: 2,
maxW: 12,
maxH: 8,
};
updateState({
charts: [...currentState.charts, newChart],
layout: [...currentState.layout, newLayoutItem],
layout: [
...currentState.layout,
{
i: newChart.id,
x: 0,
y: maxY,
w: 6,
h: 4,
minW: 4,
minH: 2,
maxW: 12,
maxH: 8,
},
],
});
},
[currentState.charts, currentState.layout, updateState],