0

Im having some issues using react-native-router-flux. My router is similar to this:

    ...
        <Scene type={ActionConst.RESET} key="tabs"
               tabs={true}>
                        <Scene
                          key="explore"
                          initial
                          component={Explore}
                       />

                        <Scene key="createPost">
                          <Scene
                            key="camera"
                            type="reset"
                            component={Camera}
                          />
                          <Scene
                            key="compose"
                            component={Compose}
                          />
                          <Scene
                            key="finish"
                            component={Finish}
                          />
                        </Scene>
                        <Scene
                          key="profile"
                          component={Profile}
                        />
 </Scene> 
...

The problem comes when I click in the createPost icon in tabs and follow the process: camera -> compose -> finish. When I'm finished with the process I should upload the data and go to explore and everything work perfect but if I try to create a new post, then it redirects me directly to "finish" scene.

So until now, when I finish the process I have tried:

Actions.explore({type: 'reset'})

//

Actions.callback({ key: 'tabs', type: 'reset'}); Actions.explore()

//

Actions.callback({ key: 'createStory', type: 'reset'}); Actions.explore()

But anything work as expected. Can someone help me with this?

Thanks!

UPDATE

Well I found a "possible" solution doing this:

Actions.popTo('capture'); -> this will go back to the first scene in createPost

Actions.explore(); -> go out of the createPost.

I guess there is another way to do it...

juangv
  • 111
  • 11

1 Answers1

0

Can you try adding type=reset to createPost scene?

<Scene key="createPost" type="reset">
Saleel
  • 889
  • 5
  • 10
  • 1
    not working. If I do that there are several issues: 1. If I do: tabs -> createPost -> (back to) tabs --> error: Cannot find route with key=explore (when I use Actions.explore()) or if I use Actions.pop() there is not scene change if I try to go back. 2. If I finish my process and I go back to scene explore and I try to open createPost again, then the app breaks. – juangv Oct 26 '16 at 15:20