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

188
Views
¿Cómo obtener rutas desde otra ubicación/función en react-router-dom v6?

Estoy probando React Router V06, pero tengo un problema en el que lo he estado intentando de esta manera, pero todas las rutas y páginas están en blanco.

Código:

 // Main App Function const App = () => { return ( <Router> <Fragment> <Navbar /> <Routes> <Route index strict path="/" element={<Landing />} /> **{/* Here I want to render paths from other function*/}** <Route element={<AppRoutes />} /> </Routes> </Fragment> </Router> ); }; export default App; // In AppRoutes Function const AppRoutes = () => ( <section className="container"> <Routes> <Route strict path="login" element={<Login />} /> <Route strict path="register" element={<Register />} /> <Route path="*" element={<NotFound />} /> </Routes> </section> ); export default AppRoutes;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En la aplicación, declare que el componente Landing es la página de índice y represente AppRoutes en una ruta "/*" para permitir la coincidencia de subrutas.

aplicación

 <Router> <Navbar /> <Routes> <Route index element={<Landing />} /> <Route path="/*" element={<AppRoutes />} /> </Routes> </Router>

AppRoutes

 const AppRoutes = () => ( <section className="container"> <Routes> <Route path="login" element={<Login />} /> <Route path="register" element={<Register />} /> <Route path="*" element={<NotFound />} /> </Routes> </section> );

Edite cómo-obtener-rutas-desde-otra-ubicación-función-en-reaccionar-enrutador-dom-v6

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!