I installed expoNavigationBar as per the Expo documents.
Importing as follows -
import * as NavigationBar from “expo-navigation-bar”;
function App() {
NavigationBar.setVisibilityAsync(“hidden”);
…
…
}
Am I using it wrong?
I checked the package.json and I have the following under “dependencies” -
“expo-navigation-bar”: “~1.0.0”,
I am getting the following alert -
[Unhandled promise rejection: TypeError: _ExpoNavigationBar.default.setVisibilityAsync is not a function. (In ‘_ExpoNavigationBar.default.setVisibilityAsync(visibility)’,
Since setVisibilityAsync is an async method and returns a promise, you will have to wait for it to resolve (or reject). In this case, you can use async/await syntax with try/catch so that the promise reject is handled.