Review ranh giới server/client trong Next.js
Kiểm tra component App Router: "use client" đặt sai chỗ, mã server-only bị lộ sang client, rủi ro hydration và bundle client nặng không cần thiết.
Prompt là văn bản bạn sao chép vào trợ lý của mình. KitLocal không chạy chúng.
Điền các biến
Những gì bạn gõ chỉ ở trong trình duyệt này. Không được thêm vào URL, không lưu và không gửi đi đâu.
Xem trước
Còn thiếu: Component code
Review this Next.js (version 16, App Router) component.
Cache Components enabled: no
Check and report, with line references:
1. Is "use client" necessary, and is it as low in the tree as possible?
2. Does any client code import server-only modules, secrets, or Node built-ins?
3. Can browser-only values (window, localStorage, Date.now, Math.random) cause a hydration mismatch?
4. Are props crossing the server → client boundary serializable?
5. Are there heavy dependencies that could be loaded lazily?
6. Are params / searchParams / cookies / headers handled with the async APIs for this version?
Answer "no issue" explicitly for items that are fine. Do not rewrite the file unless asked;
propose minimal diffs.
```tsx
{{component}}
```
Mục đích
Catch server/client boundary mistakes in Next.js App Router code before they become runtime errors or bundle bloat.
Khi nào nên dùng
- You added or moved a component and are unsure where "use client" belongs.
- A page hydrates oddly or the client bundle grew.
Cần chuẩn bị gì
- The component (and its direct imports if short), plus the Next.js version.
Đầu ra mong muốn
A numbered list (items 1-6) with verdict, evidence and a minimal diff where needed.
Về danh mục này
Bản chụp đi kèm ứng dụng · xuất bản lúc 06:05 15 thg 11, 2026 · Phiên bản danh mục 5bc079fe355af2214bc0
Đang hiển thị bản chụp đi kèm ứng dụng (chưa cấu hình nguồn nội dung). Nguồn có thể đã có nội dung mới hơn.