React-native-router-flux: How to redirect to sub-scenes?

Created on 8 Mar 2017  路  2Comments  路  Source: aksonov/react-native-router-flux

Hello,

My scenes are:

<Scene key="root" hideNavBar={true}>
    <Scene key="signPhone" component={SignPhone} initial={true} />
    <Scene key="signUp" component={SignUp} />
    <Scene key="signIn" component={SignIn} />

    <Scene
      key="app"
      tabs={true}
      tabBarStyle={{ height: 60, backgroundColor: '#BE446D' }}
    >
      <Scene key="profile" navBar={Header} component={SignPhone} title="Minha conta" icon={ProfileIcon} />
      <Scene key="appointments" navBar={Header} icon={DesqerIcon} initial={true}>
        <Scene key="calendar" component={Calendar} initial={true} />
        <Scene key="new" component={New} title="Criar servi莽o" />
      </Scene>
    </Scene>
  </Scene>

Inside my component, i import the Actions from react-native-router-flux:

import { Actions, ActionConst } from 'react-native-router-flux'

But i can't figure how to redirect user to <Scene key="new".../>

I tried to do something like this:

Actions.app_appoitments_new() or Actions.new() and none of them worked.

Thanks.

Most helpful comment

I've worked around this in the past with the following. If you were navigating from "signIn":

Actions.app()
Actions.appointments()
Actions.new()

If you were already in the app scene you wouldn't need the first one. Not ideal, but it's worked for me.

All 2 comments

I've worked around this in the past with the following. If you were navigating from "signIn":

Actions.app()
Actions.appointments()
Actions.new()

If you were already in the app scene you wouldn't need the first one. Not ideal, but it's worked for me.

Great! I just changed new to newAppointment because new is a reserved word in javascript. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sreejithr picture sreejithr  路  3Comments

moaxaca picture moaxaca  路  3Comments

tonypeng picture tonypeng  路  3Comments

sarovin picture sarovin  路  3Comments

VictorK1902 picture VictorK1902  路  3Comments