`useHits()` loose its page state in nextjs app router
duncanbla974 opened this issue Β· comments
Duncan Bla commented
π Current behavior
If you navigate to a page > 0 then click on a product and want to go back to the listing page with the navigator back button, it looks like useHits
loose the page state and show wrong products. While uiState
page or usePagination
currentRefinement are correct.
π Steps to reproduce
- Add a search query manually to the url (example: /search?instant_search%5Bquery%5D=le )
- Navigate with the pagination to go on another page ( page 2, page 3, ...)
- Click on a product
- When in product page, click on the navigator back button
Live reproduction
https://codesandbox.io/p/devbox/angry-rgb-7vdcfk
π Expected behavior
I expect the products on the listing page to be the same than before navigating to a product.
Package version
nextjs 14.1.0,
Operating system
Windows
Browser
Chrome
Code of Conduct
- I agree to follow this project's Code of Conduct