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

255
Views
How can I pass routes in Next.js?

I'm trying to pass routes to my Next.js app but it's returning an error, I've looked everywhere but I can't find the answer.

_App.tsx

import Routes from './Routes'

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <Index/>
  )
}

export default MyApp

Routes.tsx

import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'
import { SideBar } from './components/sideBar'

const Routes = () => {
  return (
    <div className={styles.container}>
      <Router>
        <Routes>
          <Route path='/' element={<SideBar />}/>
        </Routes>
      </Router>
    </div>
  )
}

export default Routes

My error:

ReferenceError: document is not defined

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

0

you can Routes like this

<BrowserRouter>
 <Routes>
  <Route path="/" element={< Home />} />
  <Route path="/yourComponentsPage" element={< yourComponent/>} />
 </Routes>
</BrowserRouter>

regards

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!