网页 综合 更新时间 2026-06-09 00:00:00

page.js

自动蜘蛛 nextjs.org 正文约 1059 字
page.js
The page file allows you to define UI that is unique to a route. You can create a page by default exporting a component from the file:
A promise that resolves to an object containing the dynamic route parameters from the root segment down to that page.
A promise that resolves to an object containing the search parameters of the current URL. For example:
Client Component pages can also access searchParams using React’s use hook:
You can type pages with PageProps to get strongly typed params and searchParams from the route literal. PageProps is a globally available helper.
Using dynamic route segments, you can display or fetch specific content for the page based on the params prop.
You can use the searchParams prop to handle filtering, pagination, or sorting based on the query string of the URL.
To use searchParams and params in a Client Component (which cannot be async), you can use React's use function to read the promise:
Last updated June 9, 2026
Subscribe to our newsletter
Stay updated on new releases and features, guides, and case studies.
访问原文 返回搜索 https://nextjs.org/docs/app/api-reference/file-conventions/page
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。