implementing search filter with nextjs and url params
anybody have any examples/docs on this matter?
5 Replies
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
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.
For building query params you could use https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
URLSearchParams - Web APIs | MDN
The URLSearchParams interface defines utility methods to work with the query string of a URL.
As for how the query params are used to filter results on client or on server is up to you
tysm will try
soon
@jingleberry thank you so much!