#HOw to get params in next13
1 messages · Page 1 of 1 (latest)
Hi @burnt jewel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
In Next.js 13, you can access the search parameters of a URL in your server components using the searchParams prop. This prop is available in the page.js component and in the generateMetadata function.
Here is an example of how you can use it in a page.js component:
export default function Page({ searchParams }) {
const { page } = searchParams;
// ...
}
In the above example, page will hold the value of the page query parameter from the URL (e.g., 1 from /credit-cards?page=1).