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?
- ✓Correct answer: The layout drops out of the shell; better to pass the promise down
- 2The build always fails with an error about dynamic params
- 3Nothing: a layout is always static regardless of
params
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.