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

322
Views
how can I comapre useParams() prev and current value

I am facing a problem where I am fetching different api's based on params?.id. I need to compare the prev and current useParams for an api call using rtkQuery. But it is not recalling my api on useparams change.

const {
    data: pipelineData,
    isLoading: pipelineDataLoading,
    error: pipelineDataError,
    isSuccess: pipelineDataSuccess,
  } = pipeline.list().usePipelinedetailQuery(
    { params: { id: params.pipelineId }, extendedPath: apiUrls.getPipeline() },
    {
      skip: !params?.pipelineId,
    },
  );

I want to use something like skip: if prev.params.id !== prams.id. there are two ways to do it. =>By setting a state to store prev value of useParams. =>by using refecthh provided by rtk query.

Is there any other authhentic way to do it.

Any help would be appreciated.

about 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
Show me some job opportunities
There's an error!