I've read several stackoverflow questions and answers about this matter and none of them seem to solve my problem.
I am using Async/await functions in a react native app and I'm trying to access data from AsyncStorage. I am trying to get a value using .getItem and then use it outside the async function. This is the function I'm using to get the data.
async _getStorageValue(){
var value = await AsyncStorage.getItem('ITEM_NAME')
return value
}
However, when I call this function and set it to a variable, like this:
returnedValue = _getStorageValue()
A promise is returned:
Promise {
"_U": 0,
"_V": 0,
"_W": null,
"_X": null,
}
How do I access the value inside this async function without using the useState hook?