React-native-router-flux: <Drawer > doesnt work for me

Created on 12 Dec 2017  路  8Comments  路  Source: aksonov/react-native-router-flux

Hi I am trying to use drawer but it doesnt work for me .

hideNavBar
key="drawer"
contentComponent={DrawerContent}
drawerImage={MenuIcon}
drawerWidth={300}
>

I have used above code and i can not navigate to complaint details.

i get a warning react.create.element type is invalid.......

I have exported all my components

Most helpful comment

All 8 comments

Which code?

hideNavBar
key="drawer"
contentComponent={DrawerContent}
drawerImage={MenuIcon}
drawerWidth={300}

I have closed all tag but my code doesnt appear with that here so i have removed it

Show all your code please, copy paste it because there's a lot of things missing there.

Ok so after checking your code, I saw that you had twice the same Scene with the key "ComplaintDetails", try to fix this.

const RouterComponent = () => {
  return (
    <Router>
      <Scene key='root'>
        <Scene key='login' component={Login} title='Login' sceneStyle={{top:55}} />
        <Scene key="tabbar" tabs={true} hideNavBar={true} tabBarStyle={{ backgroundColor: '#FFFFFF' }}>
          <Scene key="Ticketstatus1" title="Ticketstatus1" icon={TabIcon}>
            <Scene key="Active" component={NewTicket}  title="Active"/>
          </Scene>
          <Scene key="Ticketstatus2" title="Ticketstatus2" icon={TabIcon1}>
            <Scene key="solved" component={ResolvedTicket} title="Resolved" />
          </Scene>
        </Scene>
        <Scene key='FrgtPsswd' component={FrgtPsswd} title='FrgtPsswd' />
        <Scene key='ComplaintDetails' component={ComplaintDetails} title='Complaint Details' /> //THERE
        <Scene key='Dashboard' component={Dashboard} title='Dashboard' initial />
        <Drawer
          hideNavBar
          key="drawer"
          contentComponent={DrawerContent}
          drawerImage={MenuIcon}
          drawerWidth={300}>
          <Scene key='ComplaintDetails' component={ComplaintDetails} title='Complaint Details' /> //THERE
        </Drawer>
      </Scene>
    </Router>
  );
};

That issue is fixed. If I use my scene component outside drawer it works . It doesn't work inside drawer component.

I suggest you to watch the Example project if you still have some issues using this library, the Example project contains a lot of example of how to use the components you might need !

hey guys, the drawer works fine in Android, but in iOS i can't hide the status bar. Any ideas?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonypeng picture tonypeng  路  3Comments

llgoer picture llgoer  路  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments

maphongba008 picture maphongba008  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments