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
¿Por qué React BrowserRouter no devuelve cada componente según la URL como debería?

Soy bastante nuevo en React y estoy tratando de hacer que el BrowserRouter se reproduzca correctamente. Sin embargo, cuando esto hace:

 ReactDOM.render( <ApolloProvider client={client}> <Router> <Routes> <Route element={<Nav />} /> <Route path="/" element={<Search />}> <Route path="search" element={<Content />} /> </Route> </Routes> </Router> </ApolloProvider>, document.getElementById('root') )

Todo lo que aparece en la página es la barra de búsqueda, independientemente de si estoy en el índice o en /search. Me gustaría que los elementos de Nav y Search aparezcan en todas las páginas, y que cualquier componente anidado aparezca solo en su ruta especificada (p. ej., /buscar Content ). BrowserRouter as Router . ¡Cualquier ayuda es muy apreciada!

about 4 years ago · Santiago Trujillo
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!