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

Reset stack however pass data between screens #2795

Closed
Schabaani opened this issue Jan 14, 2018 · 4 comments
Closed

Reset stack however pass data between screens #2795

Schabaani opened this issue Jan 14, 2018 · 4 comments

Comments

@Schabaani
Copy link

Schabaani commented Jan 14, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux 4.0.0-beta.27
  • react-native 0.51.0
  <Router>
        <Scene>
            <Scene
                key="login"
                component={LoginScreen}
                initial
                type="reset"
            />
            <Scene
                key="registerScreen"
                component={RegisterScreen}
            />

            <Scene
                key="codeValidationScreen"
                component={CodeValidationScreen}
            />

            <Drawer
                hideNavBar
                key="drawerMenu"
                contentComponent={SideMenu}
                drawerWidth={250}
                drawerPosition="right"
            >
                <Scene
                    key="profileScreen"
                    component={ProfileScreen}

                />
                <Scene
                    key="carsListScreen"
                    component={CarsListScreen}
                />

                <Scene
                    key="carViewScreen"
                    component={CarViewScreen}
                />

            </Drawer>
        </Scene>





    </Router>);

And:
Actions.drawerMenu(params)

Actual behaviour

I want to navigate from login to drawerMenu. After login I need to reset stack that I cant go back.
In loginScreen:

const params= {
            user_name: data.params.name,
            user_id: data.params.id,
           type: 'reset'
            };
Actions.drawerMenu(params)

After reset, in destination(SideMenu) I dont have access to user_id and user_name
In SideMenu

const {params} = this.props.navigation.state;
//parasm.user_id == undefinded

Expected behaviour

I need to reset and access information that pass to destination. What should I do?
If I don't reset, user_id and other info are defined. But I can go back.

@ZeroCool00
Copy link

any solution yet?

@Schabaani
Copy link
Author

Schabaani commented Apr 24, 2018

I am using redux for passing data and react-native-router-flux only for navigation.

@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
@vickykeshri
Copy link

Did anyone got the answer. Please post it here. I am still not finding the solution

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