fix dropdown select option function stale closure

This commit is contained in:
Kartik Gupta 2024-11-08 11:22:02 +05:30
parent 09ddcf7910
commit 786024629c

View file

@ -145,6 +145,16 @@ export const DropDown = function DropDown({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
const exposedVariables = {
selectOption: async function (value) {
selectOption(value);
},
};
setExposedVariables(exposedVariables);
}, [JSON.stringify(properties.values)]);
useEffect(() => {
let newValue = undefined;
let index = null;