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

465
Views
React router v4: el enrutador del navegador no representa el componente principal

Actualmente estoy tratando de hacer que mi enrutador principal se active cada vez. No estoy muy seguro de la terminología aquí.

 <BrowserRouter> <Switch> <Route exact path='/browserRouterPath' component={loginComponent}/> <HashRouter> <Route path='/hashRouterPath' component={loginComponent2}/> <Route path='/' component={loggedInComponent}/> </HashRouter> </Switch> </BrowserRouter>

Componente conectado

 <Switch> <Route exact path='/' render={() => ( <Redirect to: {{pathname: '/finalComponent'> }}/> )}> /> ... </Switch>

Mi problema actual es que mis componentes en el hashRouter no están siendo llamados. Cuando logInComponent lo redirige a la nueva ruta, no se llama al hashRouter.

Sin embargo, si elimino el hashRouter en el primer bloque de código. El hashRouter se llama sin incidentes, pero eso rompe el CSS/estilo de los componentes del programa.

¿Hay alguna manera de representar el componente principal cada vez? ¿O hay una solución alternativa que elimine el hashRouter pero mantenga el CSS para mí?

over 4 years ago · Juan Pablo Isaza
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
Virtual assistant