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

Drawer child scene popping up as a Modal when its props are refreshed #2989

Closed
andruxnet opened this issue Apr 11, 2018 · 1 comment
Closed

Comments

@andruxnet
Copy link

Drawer child gets popped up into the stack when its props are refreshed. I do this because this component is my main component, and it's setup with tabs from 'react-native-tab-navigator'.

It was working fine before v4, but I had to upgrade because of needing newer RN features, and v3 was throwing some errors that were fixed by upgrading to v4.

So, I currently have this structure, where all works fine except for the Drawer child popping up on top of the original scene every time I refresh its props by tapping a tab inside it.

<Router>
  <Overlay key='overlay'>
    <Modal key='modal'>

      <Scene key='root'>
	<Scene key='landing' initial component={LandingScreen} type={ActionConst.REPLACE} />
        <Scene key='loginScreen' component={Login} type={ActionConst.REPLACE} />

        <Drawer key='drawer' contentComponent={DrawerContent} drawerIcon {NavItems.hamburgerButton}>
          {/* if I include the wrapper scene as shown in the Example project, the "back" icon is not displayed, instead I see the hamburguer icon in all pushed scenes */}
          <Scene key='home' component={Home} type={ActionConst.REPLACE} />
        </Drawer>

        {/* these will be pushed normally, and should show the "back" icon to go back to the previous scene */}
        <Scene key='photosViewer' component={PhotosViewer} />
        <Scene key='friendsViewer' component={FriendsViewer} />
        <Scene key='groupsViewer' component={GroupsViewer} />
        <Scene key='pagesViewer' component={PagesViewer} />
      </Scene>

      {/* modal scenes */}
      <Scene key='postModal' component={Post} />
      <Scene key='tosModal' component={Tos} />
      <Scene key='privacyModal' component={Privacy} />
    </Modal>
  </Overlay>
</Router>

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.27
  • react-native v0.50.4

Expected behaviour

When I click on an icon inside the Home scene, it refreshes the scene to change the title in the navbar.

Actual behaviour

When I click on an icon inside the Home scene, it refreshes the scene to change the title in the navbar, and then it opens a modal with the Home scene in it on top of the original Home scene.

Steps to reproduce

N/A

@aksonov
Copy link
Owner

aksonov commented Jun 6, 2018

Try to make drawer as part for modal, feel free to reopen if it doesn't help

@aksonov aksonov closed this as completed Jun 6, 2018
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

2 participants