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

How to remove Scene From history stack. #3127

Closed
prasanthyejje opened this issue Jul 13, 2018 · 1 comment
Closed

How to remove Scene From history stack. #3127

prasanthyejje opened this issue Jul 13, 2018 · 1 comment

Comments

@prasanthyejje
Copy link

prasanthyejje commented Jul 13, 2018

In my app i have multiple pages(components), every page has LOGOUT on it's header. when user clicks logout i am navigating to login page by using ### Actions.login(). here home component instance is not deleting from the react router flex history stack.

Actions.pop({ key: 'homePageComponent' }) not resoving my issue. if is there any better solution please let me know.

@aksonov Please help me.
Thanks in advance.

Explanation Of App Process :
1): my initial page is splash screen.
2): 2nd page is login page:
3): 3rd is Home Screen. in home screen there are 2 buttons .
---> if we click 1st button of home screen, i am navigating to ButtonOnePage.
---> if 2nd Button Clicks Navigating to ButtonTwoPage.
---> both pages has log out option on their header view. if log out clicks i am navigating to LOGIN
screen.( using ### Actions.login() ).

Expected behaviour

---> Home Screen Should Render Only Once irrespective of LOGIN and LOGOUT attempts.
---> And Also on LOGOUT action, i should clear the HomePage Component Scene instance from router-flex stack.
---> I tried ### Actions.pop({ key: 'homePageComponent' }); . but it is not working.

Actual behaviour

---> When I Logout from ButtonTwoPage(component) And Again LogIn. Home Screen Is Rendering Two
Times.

###My observation

---> my observation is that i am pushing Home page component into router-flex history start after user login.(by using ### Actions.Homescreen())
---> so that if i login for first time i am pushing home component , if i login for second time again am pushing a homepage component. i think this is the reason for multiple renders.

Version

Dependency Version : react-native-router-flux": "^4.0.0-beta.24"
version of RN is: 0.50.3
react-native-cli: 2.0.1
My Device : windows-7, 64-bit , 8GB RAM

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

It is not supported right now, but you always can pass custom reducer to modify navigation state for new action.

@aksonov aksonov closed this as completed Aug 8, 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