🩹(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:
@@ -30,7 +30,7 @@ export const SelectMonoSimple = (props: SubProps) => {
|
||||
}
|
||||
|
||||
downshiftReturn.selectItem(optionToSelect ?? null);
|
||||
}, [props.value, props.options]);
|
||||
}, [props.value, props.downshiftProps.initialSelectedItem]);
|
||||
|
||||
return (
|
||||
<SelectMonoAux
|
||||
|
||||
Reference in New Issue
Block a user