Next.js 16 Core Patterns - 构建 Next.js 16 App Router 功能
提供 Next.js 16 App Router 的生产实践模式,涵盖服务端数据获取、Server Actions、表单、路由和流式渲染。
标签
更新于: 2026-10-02能力
典型输入
典型输出
该技能可以做什么
- 使用 Server Components 获取数据
- 使用 Server Actions 执行变更
- 处理异步路由参数
- 使用 useActionState 构建表单
- 使用 Suspense 实现流式渲染
- 配置严格路由类型
- 验证 Server Action 输入
- 使用 proxy 实现 Node.js 拦截
输入
- Next.js 应用
- app 目录
- 路由和布局
- Server Action 需求
- 表单数据
- 路由参数
- 应用数据源
输出
- Next.js 页面和布局代码
- Server Action 代码
- 客户端表单组件
- 经过验证的 Action 响应
- 重新验证的应用路径
- 流式 UI 状态
- 路由类型检查反馈
要求
- Next.js 16
- React 19
- proxy 所需的 Node.js 运行时
- Server Actions 支持
