Router.push/replace does not work while setting search parameters
Unanswered
Orinoco Crocodile posted this in #help-forum
Orinoco CrocodileOP
I am building an app to track monthly expenditures using Next.js. Cache components and the react compiler are enabled, and the app is hosted on Vercel.
The issue that I am facing is how setting the route (with updated search parameters) using router.push() or router.replace() does not seem to work in production, but works in development, when using my custom hook useSearchParamState. Moreover, I do not see what is causing this because there are no error logs.
Relevant files to check:
lib/hooks.ts - useSearchParamState
components/expense-list/expense-list-filters.tsx
components/expense-list/expense-list.server.tsx
Here is the link to the GitHub: https://github.com/kkapoor15904/expense-app
Any help regarding this is appreciated!
The issue that I am facing is how setting the route (with updated search parameters) using router.push() or router.replace() does not seem to work in production, but works in development, when using my custom hook useSearchParamState. Moreover, I do not see what is causing this because there are no error logs.
Relevant files to check:
lib/hooks.ts - useSearchParamState
components/expense-list/expense-list-filters.tsx
components/expense-list/expense-list.server.tsx
Here is the link to the GitHub: https://github.com/kkapoor15904/expense-app
Any help regarding this is appreciated!