Unnecessary warning: An <IndexRoute> is not allowed for <TabsRoute>?

Open
#70 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react-native
Domain
frontend, mobile

Research direction

Start with the TabsRoute and IndexRoute handling described in the reproduction, then trace where the warning "An is not allowed for " is produced. Recreate the supplied router configuration and verify that an IndexRoute used with TabsRoute still sets the initial route without emitting the warning.

Written by the indexing model from the issue text.

Description

This project contains components that are currently under active development and considered experimental. If it is something you can debug and fix, please consider submitting a pull request instead!


Version
Dependency Version
react-router-native 2.0.0-beta.0
react-router 3.0.0
react-native 0.37.0
Expected Behavior

First of all, thank you for creating this library and sharing with the community.

We are migrating from the react-router-native-flux library. I have an IndexRoute in a TabsRoute that sets the initial active route, similar to an IndexRedirect from react-router.

const to = (value) => (nextState, replace) => replace(value);

...

<TabsRoute path={routes.default} component={TabBarNavigation} >
   <IndexRoute onEnter={to(routes.cart)} />
   <Route path={routes.cart} component={CartContainer} />
   <Route path={routes.shop} component={Shop} />
   <Route path={routes.account} component={Account} />
</TabsRoute>

The IndexRoute definition is working just fine, except I am seeing a warning:

Warning: An <IndexRoute> is not allowed for <TabsRoute>
Actual Behavior

I believe an IndexRoute should continue to work in this configuration, but with no warning.

Steps to Reproduce

See router configuration above.

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.