implementing search filter with nextjs and url params

anybody have any examples/docs on this matter?
5 Replies
kdiffin
kdiffin2y ago
this is how my app looks for reference basically i wanna push the value of the input to the url and then access it to filter the countries below
jingleberry
jingleberry2y ago
The router package lets you update the URL and get the path + query params https://nextjs.org/docs/api-reference/next/router
next/router | Next.js
Learn more about the API of the Next.js Router, and access the router instance in your page with the useRouter hook.
jingleberry
jingleberry2y ago
URLSearchParams - Web APIs | MDN
The URLSearchParams interface defines utility methods to work with the query string of a URL.
jingleberry
jingleberry2y ago
As for how the query params are used to filter results on client or on server is up to you
kdiffin
kdiffin2y ago
tysm will try soon @jingleberry thank you so much!
Want results from more Discord servers?
Add your server