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

182
Views
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 answers
Answer question

0

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

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!