Closed whitestranger7 closed 3 years ago
Try running it on Mobile
.
Also resolved in #316
Also resolved in #316
I dont see tabNavigaton fix in #316. Let's merge #316 first and then merge this pr to master
Also resolved in #316
I dont see tabNavigaton fix in #316. Let's merge #316 first and then merge this pr to master
For me the getFocusedRouteNameFromRoute(route); doesn't work - it returns undefined
always. I think it should work, but it doesn't. Maybe you use Navigator differently than they think? This propsed fix gets rid of the warning, but doesn't solve the problem - it does not hide the menu.
What does work: simply use
const currentRoute: string = route.name;
(and the isOneOfRootRoutes change)
full code that works for me & hides the bottom bar:
const isOneOfRootRoutes = (currentRoute: string): boolean => {
return ROOT_ROUTES.find(root_route => currentRoute === root_route) !== undefined;
};
const TabBarVisibleOnRootScreenOptions = ({ route }): BottomTabNavigationOptions => {
const currentRoute: string = route.name;
return { tabBarVisible: currentRoute && isOneOfRootRoutes(currentRoute) };
};
@jcjveraa
Thanks for chipping in. Just one proposal here: we can use double negation instead of explicit undefined check.
const isOneOfRootRoutes = (currentRoute: string): boolean => {
- return ROOT_ROUTES.find(route => currentRoute === route) !== undefined;
+ return !!ROOT_ROUTES.find(route => currentRoute === route);
};
const TabBarVisibleOnRootScreenOptions = ({ route }): BottomTabNavigationOptions => {
const currentRoute: string = route.name;
return { tabBarVisible: currentRoute && isOneOfRootRoutes(currentRoute) };
};
Please read and mark the following check list before creating a pull request:
[x] I read and followed the CONTRIBUTING.md guide.
Short description of what this resolves:
Remove warnings by upgrading async storage package and updating navigation functionality
Blocked by #316