aksonov / react-native-router-flux

The first declarative React Native router
MIT License
8.99k stars 2.11k forks source link

Reset method is not resetting state of origin Stack before moving to another Stack #3342

Open jelenadj opened 5 years ago

jelenadj commented 5 years ago

Version

If I have two stacks with a few scenes inside of them, is it possible to reset state of origin Stack, once when "reset" is invoked with the key of Scene from another Stack?

For better understanding, this is an example of structure:

<Stack key="firstStack">
    <Scene initial={true} key="firstStackFirstScene">
</Stack>
<Stack key="secondStack">
    <Scene initial={true} key="secondStackFirstScene">
    <Scene key="secondStackSecondScene">
</Stack>

Steps:

  1. open secondStack with its initial secondStackFirstScene and push secondStackSecondScene on the navigation stack
  2. from that second view invoke Actions.reset("firstStackFirstScene"), it will display first stack - all good,
  3. now invoke Actions.secondStack() from there
  4. it will display secondStackSecondScene instead of second Stack's initial scene - secondStackFirstScene

Question: Is there a way to reset state of that second stack, once when navigation is moved to another Stack using "reset" method?

lordenas commented 5 years ago

I also can't reset the previous state Scene ((