implementing search filter with nextjs and url params

anybody have any examples/docs on this matter?
5 Replies
kdiffin
kdiffin15mo 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
jingleberry15mo 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
jingleberry15mo ago
URLSearchParams - Web APIs | MDN
The URLSearchParams interface defines utility methods to work with the query string of a URL.
jingleberry
jingleberry15mo ago
As for how the query params are used to filter results on client or on server is up to you
kdiffin
kdiffin15mo ago
tysm will try soon @jingleberry thank you so much!