-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support for "replace" navigation action? #50
Comments
cc @hedgerwang |
@aksonov : do you have a minimum repro? perhaps you can reproduce this with the modified |
@hedgerwang It is difficult to provide minimum repo, because 'replace' action is not supported by NavigationCardStackExample. I was able to reproduce it in Example project for my react-native-router-flux component, please check 3.0alpha branch: I'm doing 'replace' action there within componentDidMount of Launch class (to Login screen). |
@aksonov : Does
|
No, replace means to replace one scene to another scene (with unmounting of previous scene) - what old Navigator does |
I see. I think you could start with adding
|
I did it already with own reducer. The problem in that warning. Probably because replaced component is unmounted before transition ends.. Pavel.
|
Do you want the replaces navigation state to go way with animation or just be removed immediately? What kind of warning that you were getting? Could you please share a screenshot for that? Thanks. |
Screenshot is shown at first message - i was not able to see where is that setState call. I could live without animation, but community of my component also want possibility of animation... |
any update on this ? just showing my interest in this issue/feature :) |
After upgrading to 0.24rc, replace action stops working at all, @hedgerwang, @ericvicenti Is there any docs how to migrate from 0.22 to 0.24rc (or 0.23)? I'm just replacing current element in the state with new one within reducer. It worked well within 0.22, but not for 0.24rc (0.23) |
If the new child state has a new key, it should get replaced. Otherwise it should get re-rendered. I'll look into it this afternoon. There are a bunch of reports on this, so it looks like something is seriously broken 😢 |
@ericvicenti yep, broken for me too. |
Same issue here even on 0.25.1... any progress on this? |
@mmazzarolo Seems 0.26-rc works fine. |
I implement 'replace' support with my own reducer (just changing state.children[state.index]), it works except I'm getting yellow warning setState can only update a mounted component - i believe i've broken built-in NavigationCard animation stuff (any way to disable it?). Any possible solution to avoid warning?
The text was updated successfully, but these errors were encountered: