Skip to content

How do I use Actions.reset() method? #23

@xkawi

Description

@xkawi

Hi,

Thanks for the great work.

My intention is that after a few push navigations that result to stack like this: [page1, page2, page3], and upon clicking a button on page3 I want to show page1 and reset the stack to: [page1]

I have tried these methods:

  1. on page3 render method: <Button onPress={()=>Actions.reset()}>OK</Button>
  2. on page3 render method: <Button onPress={()=>Actions.reset('page1')}>OK</Button>
  3. on page1(initial page): Add type='reset' attribute for page1 Route defined in the main source code (index.ios.js)

However all methods result in this error:
screen shot 2015-10-17 at 11 00 45 pm

Here is the debug console from chrome:
screen shot 2015-10-17 at 11 15 36 pm

It seems that page.initial = undefined hence unable to find the route, could this be the cause? if yes, how should I rectify it? if not, which part am I doing wrong?
let me know if you need more information.
thank you.

PS: I installed version 0.3.4 if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions