Route guards for searchparams in nextjs

Is there any good way of parsing searchparams, asserting them to a schema and rewriting/redirecting the request to a url with corrected searchparams while maintaining full typesafety? I've written some code in the middleware, but I have zero typesafety regarding the search params in the pages and need to manually assign the types. Is there a good way to declare what kind of params a page takes?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server