react-nativereact-native-router-flux

React Native: Getting Extra Grey Bar at the top of UI


My code repo is at:

https://github.com/samrao2/manager-4

I am getting an extra grey menu bar at the top and don't know how to get rid of this. My hunch is that this happened because I have an extra scene TAG in my Router.js file but I had to put that in per the recommended solution to solve this issue with this solution.

Now I am getting an extra grey bar at the top (above "please login" bar) of all my screens, does anyone have any ideas?

enter image description here


Solution

  • Ahhhh, the udemy course....it's a bit outdated. React-Native-Router-Flux is now based on React-Navigation, so you have to add in a Stack. Not sure if my code is 'best practice', but this will take care of the grey bar (it stumped me, too.)

      <Router sceneStyle={{ paddingTop: 0 }}>
        <Stack key="root" hideNavBar="true">
         <Scene key="auth">
            <Scene key="login" component={LoginForm} title="Please Login" />
            <Scene key="createUser" component={CreateUser} title="Create A New Account" />
            <Scene key="password" component={PasswordReset} title="Reset Your Password" />
      </Scene>
        <Scene key="main">
           <Scene
            onRight={() => Actions.employeeCreate()}
            rightTitle="Add"
            key="employeeList"
            component={EmployeeList}
            title="Employees"
            initial
           />
        </Scene>
      </Stack>
    </Router>
    

    There's a couple more scenes here in my auth key, but you should get the idea.