I am trying the retrieve the top, right, left , bottom values of SafeAreaView in react native using this function:
If I directly console.log in my function inside the function like this
const SafeAreaSpecs = async () => {
console.log(await SafeArea.getSafeAreaInsetsForRootView());
};
it gives me this:
Which is exactly what I want. But if I return SafeAreaSpecs()
and call it somewhere else like this
const SafeAreaSpecs = async () => {
return await SafeArea.getSafeAreaInsetsForRootView();
};
...
...
...
console.log(SafeAreaSpecs());
I get this:
As you can see, i can still access safeAreaInsets
but I can't figure out how to get rid of _40. _65, _55, _72. What is the proper way of storing and calling the returned value?
I have looked at this post How do I return the response from an asynchronous call? but it didn't help. not sure what I'm doing wrong