0

I have this configuration of the routers in my app --

<Router navigationBarStyle={styles.navBar}
                titleStyle={styles.navBarTitle}
            >
                <Scene key="modal" component={Modal}>
                    <Scene key="drawer" component={Drawer} open={false} type="replace" initial={this.state.flag ? false : true}>

                        <Scene key="mywishlist" component={MyWishlist} title="WISHLIST" type="replace" />
                        <Scene key="faq" component={FAQ} title="FAQ" type="replace" />
                        <Scene key="profilepic" component={ProfilePic} />
                        <Scene key="changepassword" component={ChangePassword} panHandlers={null} />
                        <Scene key="addressmanage" component={AddressManage} />
                        <Scene key="dishsearch" component={DishSearch} />
                        <Scene key="feedback" component={Feedback} hideNavBar type="replace" />
                        <Scene key="logout" component={Logout} hideNavBar type="replace" />
                    </Scene>
                    <Scene key="auth" initial={this.state.flag ? true : false} >
                        <Scene key="login" panHandlers={null} component={Login} title="Login" hideNavBar={true} type="replace" />
                        <Scene key="otp" panHandlers={null} component={OTP} title="OTP" hideNavBar={true} />
                        <Scene key="signup" panHandlers={null} component={SignUp} title="SignUp" hideNavBar={true} type="replace" />

                        <Scene key="coachmark" component={Coachmark} hideNavBar />
                    </Scene>
                    <Scene key="popUpImagePicker" panHandlers={null} component={PopUpImagePicker} title="PopUpImagePicker" hideNavBar={true} />
                    <Scene key="appModal" component={AppModal} />
                </Scene>

            </Router >

As soon as I come in logout I call Actions.auth() in my componentWillMount() to come to login screen but it is not working. Any suggestions on why not working and how can I route to login from any screen inside "drawer"?

Linda Paiste
  • 38,446
  • 6
  • 64
  • 102
Mayank Baiswar
  • 605
  • 6
  • 20

1 Answers1

0

what do you mean by not working? Is it a routing problem? In my project, I put a TouchableOpacity then if it is onPress, it will trigger logout service that using AsyncStorage to multiget and multiremove all info from user. And then to go back again into login page I use Actions.login({ type: 'reset' }); to reset history like a discussion in this link.

Satrio Adi Prabowo
  • 570
  • 1
  • 4
  • 13