jmurzy / jmurzy/react-router-native

Navigate between StackRoute and TabsRoute, Cannot pop(-1)

Open
#56 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
639
Forks
38
PR merge metrics
No merged PRs in 30d

Description

I have an app which has a dashboard that needs login and some other screens before enter.

The dashboard has a tabbed layout so I went and use the TabsRoute for the dashboard and children and a StackRoute for the other routes.

It works, but not that very well, This is the structure of the routes I have to make:
- Frontpage screens (StackedRoute, all with the same style)
- Frontpage
- Login
- Terms and coditions
- ... some other static screens
- Main content (tabbed, and some screens with a header)
- Dashboard
- Statistics and other tabs
- Settings (StacedRoute but different styles and headers than the frontpage one)
- Settings
- Options and some forms
- Others to define

Here is the code I'm working on:

``` javascript
export class Router extends Component {
render() {
return (














)
}
}
```

Now, the problem I'm having is that there is no way to navigate back to `/terms` from `/dashboard` and viceversa. The error says it **Cannot pop(-1), the stack cannot be emptied**, so it seems to be clearing the complete history before changing between Routes.

By the Aviato example it seems to be possible to do this without loosing history, but as my app has a variety of navigation schemas and styles, I splited it instead of making all of them inside a single route

Any recomendation on how to archieve what I want?

Thanks in advance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.