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 || '')} 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}>

View File

@ -63,7 +63,11 @@ export const useUrlState = () => {
) )
: 0; : 0;
const newLayoutItem: LayoutItem = { updateState({
charts: [...currentState.charts, newChart],
layout: [
...currentState.layout,
{
i: newChart.id, i: newChart.id,
x: 0, x: 0,
y: maxY, y: maxY,
@ -73,11 +77,8 @@ export const useUrlState = () => {
minH: 2, minH: 2,
maxW: 12, maxW: 12,
maxH: 8, maxH: 8,
}; },
],
updateState({
charts: [...currentState.charts, newChart],
layout: [...currentState.layout, newLayoutItem],
}); });
}, },
[currentState.charts, currentState.layout, updateState], [currentState.charts, currentState.layout, updateState],