Skip to content

Disable backButton from navigationBar on tabs #1517

Closed
@matiasfha

Description

@matiasfha

I have the following set.

  • initial Scene a login screen
  • second Scene is a tabbar
    • Accounts Scene
    • Pendings Scene

Use case:

  • User will always need to go to login screen so login Scene is marked as initial and have a navigationBar only with title
  • After login, user navigate (automatically) to Accounts tab.
  • User should not be able to go back to login page.

With my current setup. the Accounts tab (and the other one too) shows a back button if I tap that, I get back to login screen.

How can I disable that behavior?

<Router>
    <Scene key="root">
      <Scene
        key="loginPage"
        component={LoginPage}
        title="Iniciar Sesión"
        initial
        navigationBarStyle={{ backgroundColor: primaryBlue }}
        titleStyle={{ color: white }}
        panHandlers={null}
      />
      <Scene
        key="tabbar"
        tabs
        tabBarStyle={{ backgroundColor: white,
          borderTopWidth: 0.5,
          borderColor: lightGray,
          opacity: 1 }}
        renderBackButton={null}
      >
        <Scene
          key="saldos"
          component={SaldosPage}
          title="Saldos"
          navigationBarStyle={{ backgroundColor: primaryBlue }}
          titleStyle={{ color: white }}
          icon={TabIcon}
        />
        <Scene
          key="other"
          component={SaldosPage}
          title="Other"
          navigationBarStyle={{ backgroundColor: primaryBlue }}
          titleStyle={{ color: white }}
          icon={TabIcon}
        />
      </Scene>
    </Scene>
  </Router>

Version

  • react-native-router-flux v3.37.0
  • react-native v0.39.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions