React-native-router-flux: Actions.push with params not working with Drawer

Created on 30 Jan 2018  Â·  12Comments  Â·  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.28
  • react-native v0.52.0

Expected behaviour

Actions.push('scene', { back: true }); shows a back button when the scene is pushed onto the stack and displayed

Actual behaviour

Scene is pushed on to the stack but no back button is displayed

Steps to reproduce

This is my router definition:

<Router navigationBarStyle={navBarStyle.headerBg} titleStyle={navBarStyle.headerFg}>
                <Scene key="root" hideNavBar>
<Scene key="main" initial={this.props.isLoggedIn}>
                        <Scene drawerPosition="right" headerTintColor="#fff" key="drawer" title="Welcome" hideNavBar contentComponent={SideMenu} drawer>
                            <Scene key="home" component={Main} title="Welcome" />
                            <Scene key="brandlist" component={BrandList} title="Select Brand" />
                            <Scene key="specs" component={SpecList} title="Specifications" back /> 
                        </Scene>
                    </Scene>
</Scene>
</Router>

And within the SideMenu component I call Actions.push('brandlist', { back: true, title: 'Select Something' });

The scene is correctly loaded but I can't change any params, such as add back button or change title.

Seems like this should work according to the docs but it doesn't ?

Most helpful comment

_It works for me_! This is my code:
I have a left menu (Drawer).
NB: It works if in my menu.js I call "Actions.team_nav()" and NOT "Actions.my_team()" and then I can pass data to "show_player_from_team" with "Actions.push("show_player_from_team",{player: player})"

<Router>
      <Stack key="root">
        <Lightbox key="lightbox">
            <Drawer
              hideNavBar
              key="drawer"
              contentComponent={MenuContent}
              drawerIcon={IconMenuBtn}
              backButtonImage={MenuBackIcon}
              drawerWidth={300}
              initial
            >
              {/* My Team navigation */}
              <Scene key="team_nav">
                  <Scene
                    key="my_team"
                    component={MyTeam}
                    title={genericLocalizedString.lblIlMioTeam}
                  />
                 <Scene
                    key="show_player_from_team"
                    component={ProfileUser}
                    title={genericLocalizedString.lblAggiungiGiocatore}
                    back
                  />
              </Scene>
           </Drawer>
        </Lightbox>
      </Stack>
    </Router>

All 12 comments

Any news?

same problem

Same problem. Anyone find a solution?

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

_It works for me_! This is my code:
I have a left menu (Drawer).
NB: It works if in my menu.js I call "Actions.team_nav()" and NOT "Actions.my_team()" and then I can pass data to "show_player_from_team" with "Actions.push("show_player_from_team",{player: player})"

<Router>
      <Stack key="root">
        <Lightbox key="lightbox">
            <Drawer
              hideNavBar
              key="drawer"
              contentComponent={MenuContent}
              drawerIcon={IconMenuBtn}
              backButtonImage={MenuBackIcon}
              drawerWidth={300}
              initial
            >
              {/* My Team navigation */}
              <Scene key="team_nav">
                  <Scene
                    key="my_team"
                    component={MyTeam}
                    title={genericLocalizedString.lblIlMioTeam}
                  />
                 <Scene
                    key="show_player_from_team"
                    component={ProfileUser}
                    title={genericLocalizedString.lblAggiungiGiocatore}
                    back
                  />
              </Scene>
           </Drawer>
        </Lightbox>
      </Stack>
    </Router>

hey @matteocollina - I am having a similar problem right now and I know this post is very old, I was curious what you meant by your solution. When you said "and then I can pass data to "show_player_from_team" with "Actions.push("show_player_from_team",{player: player})"

Are you making 2 Action calls to pass data to "show_player_from_team" ?

@alittletf with my version I can transfer data from one scene to another ({player: player}).
1) from app.js (root scene in my app) to MyTeam.js (Actions.team_nav())
2) from MyTeam.js to ProfileUser.js with the transfer of data (Actions.push("show_player_from_team",{player: player}))

@matteocollina what versions are you on for:

React-native-router-flux:
React:
Redux:
React-Redux:

Thank you so much in advance!

@alittletf
React-native-router-flux: 4.0.0-beta.31
React: 16.3.1
Redux: 4.0.1
React-Redux: 5.1.1
React-Native: 0.55.4

Hey guys - I am having troubles to have my environment back to work since I have stopped with react-native for a while. As soon I get it back running, I'll get some feedback on this for you. I'm getting familiar with the ton of changes since my last contribution to the project.

@aksonov if possible - could you email me or send me a couple of instructions about the new version or procedure changes in my absent? thank you.

Hi, welcome back!

If you are about RNRF 4.1.0-beta.x install - nothing is changed except react-native-gesture-handler (required by react-navigation 3.x)

On 29 Mar 2019, at 14:05, Davis Z. Cabral notifications@github.com wrote:

@aksonov https://github.com/aksonov if possible - could you email me or send me a couple of instructions about the new version or procedure changes in my absent? thank you.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/aksonov/react-native-router-flux/issues/2843#issuecomment-477990419, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQpcbexyfSEZknia8yLfzcOe2MK_KRAks5vbg-vgaJpZM4RybXJ.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wootwoot1234 picture wootwoot1234  Â·  3Comments

sreejithr picture sreejithr  Â·  3Comments

fgrs picture fgrs  Â·  3Comments

basdvries picture basdvries  Â·  3Comments

booboothefool picture booboothefool  Â·  3Comments