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

151
Views
How to create multiple pages on React

So I've check multiple posts and websites and I can't get it to work. It just renders a white screen with a the navbar. This is the code:

App.js:

import {BrowserRouter as Router, Routes, Route} from 'react-router-dom'


function App() {
  return (
    <Router>
    <Nav/>
    <Routes>
      <Route path='/about' element={About}/>
    </Routes>
    </Router>
  );
}

export default App;

Index.js:

ReactDOM.render(<React.StrictMode><App/></React.StrictMode>, document.getElementById('root'))

Some component:

<Link to="/about" className="btn btn-colored">Launch</Link>

The 'About' component is working cause I've tested and imported into App.js so that is not the problem.

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

0

You need to first import the component you want to render

For example you want to render About component so you would import the About component

  1. Import the component

    import About from "./pages/About";

  2. Fix the syntax as in react-jsx we write it in </> brackets.

    <Route path='/about' element={} />

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!