Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
Open multiple pages with React Router Dom and Redux

I need to create a link which opens more than one route in a new tab when I click on the "Box" component. I'm using Redux That's the template I'm following, but I'm stucked cause it seems it is not persisting state (which contains authentication datas) opening in a new tabs.

const onClickBox = () => {
   onClickPageOne();
   onClickPageTwo();
}

const onClickPageOne = () => {
   dispatch(actions.fetchDataPageOne)
}

const onClickPageTwo = () => {
   dispatch(actions.fetchDataPageTwo)
}

return (
   <>
      <Box
         onClick = {onClickBox }
      >
         Click me!
      </Box>
   </>
)

I tried using Link component by react-router-dom but I need only one link for both pages so I don't know what to put in 'to' prop. I tried using Redirect in onClickBox function but I don't get how to tell him to open in a new page.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use single function to dispatch bothh actions from there only

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda