Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formData code snippet in route handler docs (#52532)
### Why? The code snippet in the Route handler `formData` documentation ```ts import { NextResponse } from 'next/server' export async function POST(request: Request) { const formData = await request.formData() return NextResponse.json({ formData }) } ``` is slightly wrong, because `formData` is not a plain object and hence `return NextResponse.json({ formData })` doesn't actually work. Since we are already in the topic of parsing `formData`, I also added a mention on `zod-form-data` which can be used to validate the form and parse it to non-string formats such as `number`.
- Loading branch information