Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
React routed dom reverting back to the default route

I am trying to implement nested routes in react router dom v6 and the router keeps sending me back to the default or index route as soon as the is clicked

Router.tsx

          path="organizations"
          element={
            <ProtectedSuperadminPages currentUser={currentUser}>
              <SuperAdminOrganizationsPage />
            </ProtectedSuperadminPages>
          }
        >
          <Route
            index = {true}
            element={
              <ProtectedSuperadminPages currentUser={currentUser}>
                <div>
                  <h1>Smile</h1>
                </div>{" "}
              </ProtectedSuperadminPages>
            }
          ></Route>
          <Route
            path="org"
            element={
              <ProtectedSuperadminPages currentUser={currentUser}>
                <Dummy />
              </ProtectedSuperadminPages>
            }
          ></Route>

          <Route
            index={false}
            path="frog"
            element={
              <ProtectedSuperadminPages currentUser={currentUser}>
                <h1>YO</h1>
              </ProtectedSuperadminPages>
            }
          ></Route>
        </Route>

SuperAdminOrganizationPage.tsx

<Link to = "org">Move to org</Link>
      <Link to = "frog">Move to frog </Link>
      <Outlet />

DEMO https://youtu.be/qaTcbii8Ax0

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!