this function should return "HomeStack"
const getSessionPrevious = async () => {
try {
const value = await AsyncStorage.getItem("token"); //value default is "#$#"%2356"
if (value !== null) {
return "HomeStack";
} else {
return "LoginStack";
}
} catch (error) {
return "LoginStack";
}
};
console.log(getSessionPrevious() ); //I need get the value of the function in this line
.
.
.
rest of my code
when I do:
console.log(getSessionPrevious );
returns:
Promise {
"_40": 0,
"_55": null,
"_65": 0,
"_72": null,
}
how can get the result of this promise?