useActionState với Zod trong Next.js 16: Hướng Dẫn Form Validation Toàn Diện
Hướng dẫn đầy đủ cách dùng useActionState và Zod trong Next.js 16 để xây dựng form an toàn với validation hai lớp, Progressive Enhancement và xử lý lỗi field-level.
Tomasz is a senior frontend engineer with eleven years of experience, currently a tech lead at a Berlin-based fintech where he migrated 180 routes from CRA to Next.js 14 App Router over nine months without a single user-facing outage. Before that, four years at Klarna building the merchant dashboard in Next.js, and two years at a small agency in Krakow shipping marketing sites for European retailers. He maintains two small open-source libraries in the React ecosystem, one for typed environment variables and one for a Suspense-friendly data fetching wrapper that predates the React 19 use() hook. He prefers Drizzle over Prisma, NextAuth over Clerk for self-hosted setups, and has strong feelings about putting business logic in Server Components. He writes the kind of tutorials that show the broken intermediate state, not just the working final code.
Hướng dẫn đầy đủ cách dùng useActionState và Zod trong Next.js 16 để xây dựng form an toàn với validation hai lớp, Progressive Enhancement và xử lý lỗi field-level.
So sánh ba API cache invalidation mới trong Next.js 16: updateTag, revalidateTag và refresh(). Khi nào dùng API nào, kèm code thực tế cho CRUD, webhook và realtime updates.
Hướng dẫn chuyển đổi middleware.ts sang proxy.ts trong Next.js 16 từng bước. Bao gồm code thực tế cho authentication, CORS, rate limiting, A/B testing, i18n và các best practices.
Hướng dẫn chi tiết xây dựng ứng dụng CRUD full-stack với Next.js 16, Drizzle ORM và Neon PostgreSQL. Bao gồm Server Actions, Zod validation, Relational Queries và deploy lên Vercel với code mẫu hoàn chỉnh.