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

254
Views
React Router: As soon as iam adding content to Route its not rendering anything anymore

I am struggling with a problem i cant seem to find an answer to. As soon as I am adding a div or any other Component inside the Route it is not rendering the the content and the containing "Application" anymore. I hope I described my Problem enough and you guys know an easy solution.

import React from 'react';
import "./App.css"
import { BrowserRouter, Route, Routes } from 'react-router-dom';

function App() {
  return (  
    <div className="wrapper">
      <h1>Application</h1>
      <BrowserRouter>
        <Routes>
          <Route path="/dashboard">
            <div>hi dashboard</div>
          </Route>
          <Route path="/preferences">
            <div>hi preferences</div>
          </Route>
        </Routes>
      </BrowserRouter>
    </div>
  );
}

export default App;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The Route component expects an element prop.

Try this

<BrowserRouter>
  <Routes>
    <Route path="/dashboard" element={<div>hi dashboard</div>} />
    <Route path="/preferences" element={<div>hi preferences</div>} />
  </Routes>
</BrowserRouter>
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!