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:
parent
400d3ce2a2
commit
75d3a5d8d6
@ -25,7 +25,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
|
|||||||
onChange={(_, newValue) => onChange(newValue?.name || '')}
|
onChange={(_, newValue) => onChange(newValue?.name || '')}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
renderOption={(props, option, { inputValue }) => (
|
renderOption={(props, option, { inputValue }) => (
|
||||||
<Box component='li' {...props}>
|
<Box component='li' {...props} key={option.name}>
|
||||||
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
|
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<Typography variant='body2'>
|
<Typography variant='body2'>
|
||||||
<Highlighter search={inputValue}>
|
<Highlighter search={inputValue}>
|
||||||
|
@ -63,21 +63,22 @@ export const useUrlState = () => {
|
|||||||
)
|
)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
const newLayoutItem: LayoutItem = {
|
|
||||||
i: newChart.id,
|
|
||||||
x: 0,
|
|
||||||
y: maxY,
|
|
||||||
w: 6,
|
|
||||||
h: 4,
|
|
||||||
minW: 4,
|
|
||||||
minH: 2,
|
|
||||||
maxW: 12,
|
|
||||||
maxH: 8,
|
|
||||||
};
|
|
||||||
|
|
||||||
updateState({
|
updateState({
|
||||||
charts: [...currentState.charts, newChart],
|
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],
|
[currentState.charts, currentState.layout, updateState],
|
||||||
|
Loading…
Reference in New Issue
Block a user