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

Component inside Drawer is mounted twice #2449

Closed
iuraya opened this issue Sep 29, 2017 · 3 comments
Closed

Component inside Drawer is mounted twice #2449

iuraya opened this issue Sep 29, 2017 · 3 comments

Comments

@iuraya
Copy link

iuraya commented Sep 29, 2017

Version

  • react-native-router-flux v4.0.0-beta.21
  • react-native v0.47.1

Expected behaviour

Being in one of the scenes of the Tabs if I navigate to a scene inside the Drawer but not in the Tabs the component of the scene should be mounted one time

Actual behaviour

What I get is that the first scene that I go to is mounted twice. The next scenes are correctly mounted

Steps to reproduce

For example if I am in the home scene and, using the drawer, I try to go to editProfileTeacher scene the component of this scene will be mounted twice

Here is my Router:

<Router>
  <Scene  key="root" hideNavBar >

    <Scene key="splash" component={Splash} hideNavBar />
    <Scene key="loginContainer" back>
      <Scene key="login" component={Login} />
    </Scene>
    <Scene key="registerContainer" back>
      <Scene key="registerCredentials" component={RegisterCredentials} />
      <Scene key="registerUserInfo" component={RegisterInfoContainer} />
      <Scene key="registerType" component={RegisterType} />
    </Scene>

    <Drawer key="drawerTeacher" drawer drawerPosition="right" contentComponent={MenuTeacher} >
      <Scene key="root" hideNavBar>
      
        <Tabs
          key="tabbarTeacher"
          gestureEnabled={false}
          showLabel={false}
          tabs
          animationEnabled={false}
          icon={TabIcon}
        >
          <Scene key="homeTab" >
            <Scene key="home" component={TeacherHome} />
            <Scene key="ListStudents" component={ListStudents} back />
            <Scene key="StudentDetail" component={StudentDetail} back />
          </Scene>
          <Scene key="chatTeacherTab" >
            <Scene key="ListChat" component={ListChat} />
            <Scene back key="ActiveChat" component={ActiveChat} />
          </Scene>
          <Scene key="notificationContainer" >
            <Scene key="Notifications" component={Notifications} />
          </Scene>
          <Scene key="shareTeacherTab" >
            <Scene key="InviteUsers" component={InviteUsers} />
          </Scene>
        </Tabs>

        <Scene key="menuTeacher" hideNavBar back>
          <Scene key="editTeacher">
            <Scene key="editProfileTeacher" component={EditProfileTeacher} />
            <Scene key="editUserTeacherInfo" component={EditUserInfo} />
            <Scene key="teacherAvailableEdit" component={TeacherAvailable} />
            <Scene key="changePasswordTeacher" component={ChangePassword} />
          </Scene>
          <Scene key="conditions">
            <Scene key="conditionTerms" component={ConditionTerms} />
            <Scene key="pricesTerms" component={PricesTerms} />
            <Scene key="legalClaim" component={LegalClaim} />
            <Scene key="cookiesPolicy" component={CookiesPolicy} />
          </Scene>
        </Scene>
        
      </Scene>
    </Drawer>
    
  </Scene>
</Router>
@kesha-antonov
Copy link
Contributor

+1
did you solve it?

@SoldierCorp
Copy link

+1

@aksonov
Copy link
Owner

aksonov commented Jan 5, 2018

Looks like the issue not in RNRF (because it doesn't mount/render scenes at all):react-navigation/react-navigation#476

@aksonov aksonov closed this as completed Jan 5, 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

4 participants