useEffect(() => {
if (names.length !== 0) {
createName(id);
}
getName(id);
}, [names]);
Here both the function createName and getName is a api call that returns a promise.
Now Sometime, createName delays which is causing getName to execute without a data.
So, how to make this usEffect async using async await ?