I'm working on an app written using the pages router. I want to remove state from the files and only use the query params directly for the app. Getting the initial params on load seems to preclude the ability to use the params directly though, as I need to use router.isReady inside a useEffect, and thus the query param values would then need to be set as state.
I could try to infer when the router has loaded by checking when query params are no longer undefined, but this seems messy. I'm wondering if there are any patterns here which would be useful for this.
The App Router is useful because it has useSearchParams but converting the app over to App Router seems like a bit of a large task, especially since our project is currently using static exports and would need to switch over.