I know its not recommended to create add async to useEffect but how can I make sure my function is completely done before continuing
Here is my code
useEffect(
() => {
const RetrieverDataProcess = async () => {
const GetMainListResults = await GetMainList(FORMSTATUS.ID);
setMAINOBJECT(GetMainListResults); //useState
console.log(2)
}
console.log(1);
RetrieverDataProcess();
console.log(99);
}, [])
If I run in my console its showing
1
99
2
I was hopeing its
1
2
99