Next.js · Senior · Question 48 of 75

What happens if a layout calls await params at the top level with Cache Components and no generateStaticParams?

Explanation

Without generateStaticParams, param values are known only at request time - they're runtime data. The docs advise not to await params at the top level of a layout, but to pass the promise to the component that actually needs the value and wrap it in Suspense.

Further reading

Problem with a question

Next.js · Senior · question 48

Test yourself

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

Take this quiz