Next.js · Junior · Question 34 of 75

How do you get the ?page=2 query parameter in a server page?

Explanation

The page receives searchParams as a promise. Reading the query makes the page dynamic, because the values are known only at request time. In client components, use useSearchParams(). params contains only the dynamic path segments.

Further reading

Problem with a question

Next.js · Junior · question 34

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz