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

110
Views
why redux store becomes empty in next js when I navigate from one page to another page?

In my first page I called API through getServerSideProps function, then i got 2 id's as a response, for example id-A and ID-B, Now in my second page I want to call another API through getServerSideProps function, where I have to pass id-A and ID-B as a parameters to API. how to get it?

What I have done is I stored api response in redux state, and I am trying to access redux state in second page to call api but it becomes null

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should have your redux provider at the app/top level (_app.js) instead of the pages level. Something like this in your _app.js

export default function MyApp({ Component }) {

  return (
    <Provider store={yourStore}>
      <Component />
    </Provider>
  )
}

If you instead have your Provider set up per page, then it means the store is recreated for every new page you visit.

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!