Unnecessary warning: An <IndexRoute> is not allowed for <TabsRoute>?
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
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jmurzy/react-router-native
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 10/100
jmurzy/react-router-native#81 · 5 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
jmurzy/react-router-native#79 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
jmurzy/react-router-native#78 · 2 comments · 3 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
All issues in jmurzy/react-router-native
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
keyxmakerx/Chronicle#2284 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
soroswap/token-list#125 ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EveryInc/compound-engineering-plugin#2085 ·
Maintainers usually reply within 1 day