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

135
Views
React routing using react-router-dom v.6 doesn't show anything

so I'm trying to create routing for my react.js app by using react-router v.6. I already tried to do changes for the v.6 but for some reason my app didn't show anything, can anyone help me ?

So Navigation.js file is for Routing, Header.js filled with button for changing route and App.js is used to display them.

App.js:

    <div>
      <Header/>
      <Outlet/>
    </div>

Header.js:

<>
  <Link to="/">Home</Link>
  <Link to="/Productlist">Product</Link>
  <Link to="/Contact">Contact Us</Link>
</>

Navigation.js:

<>
    <Routes>
        <Route exact path="/" element={<Home/>}>
            <Route exact path="ProductList" element={<Product/>}/>
            <Route exact path="ContactUs" element={<Contact/>}/>
        </Route>
    </Routes>
</>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't know if this will solve your problem but first you can start by replacing your Navigation.js by :

<Routes>
    <Route path="/" element={<Home/>} />
    <Route path="ProductList" element={<Product/>}/>
    <Route path="ContactUs" element={<Contact/>}/>
</Routes>

In this case you don't need nested routes.

Then, I don't think it's a good idea to use capitalize letter in path.

about 4 years ago · Juan Pablo Isaza Report
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!