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

125
Views
Tracking state in URL params over multiple React components

I have a page which shows a list of items. These items are paginated, and can be searched, filtered, and ordered.

IndexComponent
-> SidebarComponent
   -> FilterComponentA
   -> OrderComponentB
-> ListContainerComponent
   -> SearchComponent
   -> PaginatedListComponent

There are several components here which have state related to the list which I want in the URL for page reload/URL sharing etc. The problem is that if we use react-router's useSearchParams() hook over multiple components they all end up with different versions of the searchParams and end up overriding each other due to immutability.

What is the best way to handle this situation so that we have minimal re-renders or state changes, without having to hardcode in the child state into the parent components (SidebarComponent shouldn't need to know if we add an extra filter option)?

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!