Fix TabsRoute behaviour

Open
#17 6 comments 0 reactions 1 assignee View on GitHub

@jmurzy is already working on this.

Since Jun 18, 2016.

Assessment

This issue has not been assessed yet.

Description

enhancement

TabsRoute should implement two behaviours:

  • it should save the state for each child route and restore it when switching tabs
  • it should reset a child's state if that child is being navigated to twice

Given the following route config:

<Router>
  <TabsRoute path="/" ...>
    <StackRoute path="/foo" ...>
      <Route path="a" ... />
      <Route path="b" ... />
    </StackRoute>
    <Route path="/bar" .../>
  </TabsRoute>
</Router>

Visiting routes should lead to the following results respectively:

  1. /foo --> show /foo
  2. /foo/a --> show /foo/a
  3. /foo/b --> show /foo/b
  4. /bar --> show /bar
  5. /foo --> show /foo/b (a tab route saves and restores its children's state)
  6. /foo --> should reset stack of the child stack route and show /foo
Dominant language
JavaScript
Stars
636
Forks
37
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jmurzy/react-router-native

All issues in jmurzy/react-router-native

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.