Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions.push with params not working with Drawer #2843

Open
tlloydukdev opened this issue Jan 30, 2018 · 12 comments
Open

Actions.push with params not working with Drawer #2843

tlloydukdev opened this issue Jan 30, 2018 · 12 comments
Assignees

Comments

@tlloydukdev
Copy link

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 ?

@matteocollina
Copy link

Any news?

@sajaddp
Copy link

sajaddp commented Jul 20, 2018

same problem

@d7laungani
Copy link

Same problem. Anyone find a solution?

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

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

@aksonov aksonov closed this as completed Aug 8, 2018
@matteocollina
Copy link

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>

@alittletf
Copy link

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" ?

@matteocollina
Copy link

@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}))

@alittletf
Copy link

@matteocollina what versions are you on for:

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

Thank you so much in advance!

@matteocollina
Copy link

@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

@daviscabral daviscabral reopened this Mar 29, 2019
@daviscabral
Copy link
Collaborator

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.

@daviscabral daviscabral self-assigned this Mar 29, 2019
@daviscabral
Copy link
Collaborator

@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.

@aksonov
Copy link
Owner

aksonov commented Mar 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants