🩹(frontend) fix react userEffect

in Select/mono-simple

The whole downshiftProps object change every time a update is made on it.
By observing only initialSelectedItem prop, we reduce the amount of call
of this useEffect.
This commit is contained in:
Romain Le Cellier
2023-09-22 15:18:21 +02:00
parent 3a6028f0ba
commit 859a75cebe

View File

@@ -30,7 +30,7 @@ export const SelectMonoSimple = (props: SubProps) => {
}
downshiftReturn.selectItem(optionToSelect ?? null);
}, [props.value, props.options]);
}, [props.value, props.downshiftProps.initialSelectedItem]);
return (
<SelectMonoAux