Same routes shared across multiple tabs.

Open
#25 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react-native
Domain
mobile

Research direction

Start by reviewing the route definitions and the tab and stack behavior shown in the issue, then trace how matching routes are selected during navigation. Done means common routes can be shared without copying them into every tab stack, while a matching route stays in the current tab and is pushed onto its stack.

Written by the indexing model from the issue text.

Description

question

I have a use case where there are many routes that are shared across multiple tab stacks.

Example:

<TabsRoute>
  <StackRoute>
    <IndexRoute path="/friends">
    <Route path="/user/:userId">
    <Route path="/user/:userId/followers">
  </StackRoute>
  <StackRoute>
    <IndexRoute path="/me">
    <Route path="/user/:userId">
    <Route path="/user/:userId/followers">
  </StackRoute>
</TabsRoute>

/friends shows list of friends.
/me shows my account.
/user/:userId shows a profile of a user.
/user/:userId/followers shows a list of followers for a user.

Note that user can navigate to user profile and user followers from both friends and me tab.
They also share the same url pattern.
Since all routes are pretty much somehow connected to each other (think of Facebook app), almost all routes can be accessed from any tab stacks.

Desired behavior would be not to jump around between tabs, but stay in the current one if there is a matching route under the current tab, then push the matching route to the current tab stack.
Also, it would be nice if it can be done without copying common routes to each tab stack.

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.