how to hide a screen from drawer in react navigation 5

Solutions on MaxInterview for how to hide a screen from drawer in react navigation 5 by the best coders in the world

showing results for - "how to hide a screen from drawer in react navigation 5"
Daniele
11 Mar 2018
1import { DrawerItems } from 'react-navigation';
2
3const visibleItems = ['HomeScreen', 'SettingsScreen', 'HelpScreen'];
4
5const getVisible = item => contains(item.key, visibleItems);
6
7const getFilteredAndStyledItems = ({ items, ...other }) => (
8  <DrawerItems
9    items={filter(getVisible, items)}
10    {...other}
11  />
12);
Greta
04 Apr 2016
1//custom drawer content
2export default props => {
3    const { state, ...rest } = props;
4    const newState = { ...state}  //copy from state before applying any filter. do not change original state
5    newState.routes = newState.routes.filter(item => item.name !== 'Login') //replace "Login' with your route name
6
7    return (
8         <DrawerContentScrollView {...props}>
9             <DrawerItemList state={newState} {...rest} />
10        </DrawerContentScrollView>
11    )
12}
Mathilda
27 Jun 2016
1function DrawerNavigator() {
2  return (
3    <NavigationContainer>
4      <Drawer.Navigator
5        initialRouteName="Home"
6        drawerContent={props => {
7          const filteredProps = {
8            ...props,
9            state: {
10              ...props.state,
11              routeNames: props.state.routeNames.filter(routeName => {
12                routeName !== 'Home';
13              }),
14              routes: props.state.routes.filter(route => route.name !== 'Home'),
15            },
16          };
17          return (
18            <DrawerContentScrollView {...filteredProps}>
19              <DrawerItemList {...filteredProps} />
20            </DrawerContentScrollView>
21          );
22        }}>
23        <Drawer.Screen name="Notifications" component={ProfileScreen} />
24        <Drawer.Screen name="Notifications2" component={ProfileScreen} />
25        <Drawer.Screen name="Home" component={StackNavigator} />
26      </Drawer.Navigator>
27    </NavigationContainer>
28  );
29}
30
queries leading to this page
rn navigation drawer hidehide screen from drawer navigation react nativehide drawer route react nativehow to hide drawer screen from drawer react nativehide screen links in drawernavigation in react nativehide item in react navigation drawer dont show page in menu drawer react navigationhide a tab in drawer react navigationhide a item in navigation bar react navigationhow to hide a screen in drawer navigator 6hide drawer in reacthow to hide drawer menu item in react nativehide menu of drawer navigation inreact nativehide screen in react drawer navigationhide drawer navigation react nativereact navigation drawer not hide fulldrawer navigator hide screen from side menuhide drawer item in react navigation 4hide a screen from drawer in react navigationhow to hide drawer on login screen in react nativehide item in react drawer navigationhide name in drawer screen react nativereact native drawer navigation hide componenthide drawer on open 40react navigationreact native drawer navigatior hide screenreact navigation change only one item in drawer contenthide drawer screen name react nativereact native drawer navigation hide from menudrawer screen options react navigation to hide itreact navigation drawer hide headerhow to hide header of drawer navigation react nativehide screen from drawer navigationhow to hide header in drawer menu in react navigation 6hide drawer screen react navigationreact navigation hide screen from drawerhow to hide react navigation 2fdrawer headerreact navigation remove some screen from drawerreact native navigation drawer hide labelhow to hide drawer screen react nativehide some routes in drawer react navigationreactnavigation hide drawer item screenreact native drawer navigation hide headerleft disable visibility of navigator screen react native drawerreact native navigation drawer hide routedrawer screen navigation react nativehide on drawer react navigationhide drawer navigation header react nativereact navigation setdrawer visiblenavigation drawer hide status react nativebottom navigation hide item drawer reacthow to hide drawer on press react nativehow to hide a screen in drawernavigationreact navigation hide item in drawer item listhide some screens in drawer react navigationreact native hide android navigation barnavigationcontainer drawer screen hidehow to hide a screen from drawer in react navigation 5create a short drawer from below react nativewhat to use instead of drawer item in navigation drawer in react nativereact navigation v5 how to put component in drawer but hide itreact navigation drawer hidehow to hide navigation drawer reaact nativenavigation drawer hide status bar react nativehide drawer item from navigation react nativereact navigation drawer dont closedrawer navigator crashes after navigatereact native hide android bottom bardrawer navigation react native hide in drawerdrawer screen react native hidereactnative hide drawer itemreact navigation add screen to drawer without showinghow to make navigate to a screen without it showing up in drawer react nativedrawer navigation hide screen from side menuhow to hide header in drawer navigation react nativereact navigation drawer hide menu buttonhide drawer screen react nativereact native drawer nave hide namedrawer navigation hide itemdisable drawer navigation 2freact nativereact navigation disable drawer on screenreact native navigation drawer hide screendisable drawer screen from being clicked react navigationreact native hide header drawer navigationdrawer navigation react native hidenavbarhow to hide a screen in drawer navigatorreact navigation hide drawer itemhoe to hide some drawer menu item in rect nativereact navigation hide drawer item screenreact navigation drawer screen hiddenhide in react native drawer navigationdrawer navigation react native invisible screenhide drawer screen in react native 5creact native hide page drawerreactjs drawer hide navigation onclickhow to hide a screen form drawer in react navigation 5react navigation drawer menu not show optionhow to hide a screen from drawer in react navigation 5