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

v4 replace behaves different to v3? #2102

Closed
compojoom opened this issue Jul 24, 2017 · 12 comments
Closed

v4 replace behaves different to v3? #2102

compojoom opened this issue Jul 24, 2017 · 12 comments

Comments

@compojoom
Copy link
Contributor

The normal navigation between my scenes is:
A->B->C

on scene B, you can press and add button and this would send you to scene D. When you click save, then you are sent to scene C. Now clicking the back button on scene C shouldn't send you back to scene D, but to B.
A->B->D->C
back is
C->B->A

I was able to achieve this with v3 by using type replace. Now on v4 if I use Actions.replace('D') -> then all the scenes in the stack are replaced with scene D and not just the last one. Is there a way to just replace the last one?

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

Looks like it is the problem of React Navigation:
react-navigation/react-navigation#774

If you could find solution how to do 'replace' correctly with react-navigation I could implement it with RNRF.

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

I have one idea - do Actions.pop and Actions.push for 'replace'. I will try to implement this.

@compojoom
Copy link
Contributor Author

I tried pop and then push, but I'm not sure if it was my components or what, but I was running in a "max execution callstack" error.

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

OK, I will try for Example.

aksonov pushed a commit that referenced this issue Jul 25, 2017
@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

@compojoom Could you check latest master?

@itinance
Copy link

itinance commented Jul 25, 2017

@aksonov Have you unpublished beta11 and beta12? We got an empty folder after "npm install" of an other library and while reinstalling neither beta11 nor beta12 can be found on npm.

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

Have you tried 4.0.0-beta.12 ?

@itinance
Copy link

ooops.... thx! don't know how it could work without the dot yesterday (or the dev was on del-key)^^
However, can you tell pls the roadmap for 4.0.0 - non-beta?

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017 via email

@itinance
Copy link

yes, wouldn't think that. thats why i was asking :) with git remote show origin and git branch i could see a lot of release-branches but not these both. was a bit confusing.
Originally I ran into this npm-issue that removes other dependencies sometimes and lost RNRF and all this got followed up with lots of side-issues... It's clear now :)

@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

Should be fixed with 4.0.0-beta.14

@aksonov aksonov closed this as completed Jul 25, 2017
@aksonov
Copy link
Owner

aksonov commented Jul 25, 2017

I've just added ActionConst.POP_AND_PUSH action for this (previous REPLACE could be useful to replace root scene)

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

3 participants