Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda