Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: relative navigation from index/pathless routes #8954

Merged
merged 5 commits into from
Jun 8, 2022

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Jun 8, 2022

Continuation of #8697

Closes #8350

<Route element={<Outlet />}>
<Route
path="page"
element={<Navigate to="../../about" />}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanflorence Quick double check here that this double ../.. would be the expected relative path to the /about route?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Route path="about" />
<Route path="home" element={<Outlet />}>
  <Route element={<Outlet />}>
    <Route element={<Outlet />}>
      <Route element={<Outlet />}>
        <Route
          path="page"
          element={<Navigate to="../../about" />}
        />

Should ignore all the pathless routes, so essentially we're talking about this:

<Route path="about" />
<Route path="home" element={<Outlet />}>
  <Route
    path="page"
    element={<Navigate to="../../about" />}
  />
  • .. goes up to /home route
  • .. x2 goes up to /
  • about goes to /about

So yeah, that sounds right!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants