Unverified Commit af82de42 authored by Nikola Knežević's avatar Nikola Knežević Committed by GitHub

Fix type declaration for API Routes response (#31486)

There is missing equals sign in the type declaration in the example for API Routes.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent bf973165
......@@ -85,11 +85,14 @@ You can make your response handlers more type-safe by importing the `NextApiRequ
```ts
import type { NextApiRequest, NextApiResponse } from 'next'
type ResponseData {
type ResponseData = {
message: string
}
export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) {
export default function handler(
req: NextApiRequest,
res: NextApiResponse<ResponseData>
) {
res.status(200).json({ message: 'Hello from Next.js!' })
}
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment