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

212
Views
Why doesn't the new 'Routes' syntax in React-router-dom work on my code?

I learnt that after the newly released react packages, the tag in react-router-dom do not work again so I changed to "Routes" after a couple of research online but still, it isn't working. Below is a screenshot from my PC.

My PC

Also this is the code

import React from 'react';
import Navbar from './components/Navbar'
import {BrowserRouter as Router, Routes, Route} from 'react-router-dom';
import './App.css';
import Home from './components/pages/Home';
import Services from './components/pages/Services';
import Products from './components/pages/Products';
import SignUp from './components/pages/SignUp';



function App(){
    return (
        <>
        <Router>
        <Navbar />
       
        <Routes>
            <Route exact path="/"   component={Home} /> 
            <Route path="/services" component={Services} />
            <Route path="/products" component={Products} />
            <Route path="/sign-up" component={SignUp} />
        </Routes>
        </Router>
       </>
    );
}
export default App;

//<HeroSection />
//import HeroSection from './components/HeroSection';

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

On new version of react-router-dom this should work. Check it.

<Routes>
    <Route path="/" element={<Home />} /> 
    <Route path="/services" element={<Services />} />
    <Route path="/products" element={<Products />} />
    <Route path="/sign-up" element={<SignUp />} />
</Routes>

Paste your error please. There would another issue

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!