React routing docs provide conflicting information on nested navigation

Open
#1,604 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
react
Domain
documentation

Research direction

Start at the React navigation page and compare the nested routing examples with the IonRouterOutlet guidance below. Clarify or revise the conflicting documentation so the supported approach to nested navigation is unambiguous, then verify the rendered page explains the same behavior consistently.

Written by the indexing model from the issue text.

Description

triage

URL
https://ionicframework.com/docs/react/navigation

The React Navigation document contains a small bit of conflicting information (which caused me some confusion).

The docs first showcase an example of nested routing using IonRouterOutlet:

    <IonApp>
      <IonReactRouter>
        <IonRouterOutlet>
          <Route path="/dashboard" component={DashboardPage} />
          <Redirect exact from="/" to="/dashboard" />
        </IonRouterOutlet>
      </IonReactRouter>
    </IonApp>

with the DashboardPage component further down:

const DashboardPage: React.FC = () => {
  return (
    <IonRouterOutlet>
      <Route exact path="/dashboard" component={UsersListPage} />
      <Route path="/dashboard/users/:id" component={UserDetailPage} />
    </IonRouterOutlet>
  );
};

So upon navigating to the /dashboard routes, we'd expect the DashboardPage component to work and allow for nested navigation.

However, this does not work properly. Indeed, the docs also say below:

An IonRouterOutlet should also not be a descendant from another IonRouterOutlet.

In direct contradiction with what was showcased a few paragraphs above.

Dominant language
MDX
Stars
621
Forks
3.2k
Avg merge
1d 2h
Merged PRs (30d)
86

Contributor guide

Open the contributing guide

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 ionic-team/ionic-docs

All issues in ionic-team/ionic-docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.