function check(){
const [variable, setvariable1] = useState(0);
const [variable2, setvariable2] = useState(0);
const [variable3, setvariable3] = useState(0);
const last_func = () => {
console.log("call this function")
}
const mainfunction = () =>{
setvariable(1);
setvariable2(1);
setvariable3(1);
last_func(); //this function needs to be called after completing above all state variables
}
}
i want call the last_func after completing the setting of all state variables to 1 then only i have to call that last_func