Description
Greetings, I've been scratching my head over this issue for quite awhile.
Following #368, I've been using the useSearchParams
hook and it has been working fine, until I started integrating with urql
's useQuery
.
Issue
useSearch
does not rerender if it begins with query params and revisited. For example, if I land on the page with URL
http://localhost:5173/?tab=1
I cannot go back to original tab after switching to another tab. (URL has been updated to ?tab=1
, but React does not rerender the components. You may see the video below:
Screen.Recording.2023-12-01.at.8.59.27.PM.mov
Reproduction Steps
-
Clone https://github.com/junwen-k/react-router-wouter
git clone https://github.com/junwen-k/react-router-wouter cd react-router-wouter
-
Install dependencies
npm install
-
Start Server
npm start
-
Experiment with the page, with default
?tab=1
triggers the issue
Context
Suspect pushState
event does not trigger, hence React does not rerenders the component.
React Router's version works perfectly, so I suspect this is something to do with wouter
.