Skip to content

Commit

Permalink
fix: remove unnecessary parentheses in draft mode API (#75153)
Browse files Browse the repository at this point in the history
## What?
Updates the draft mode documentation to fix incorrect method calls in
the code examples.

## Why?
The code examples were showing incorrect syntax for enabling and
disabling draft mode, using `draft()` instead of accessing the methods
directly on the `draft` object.

## How?
Removes the unnecessary parentheses when calling `enable()` and
`disable()` methods on the draft mode object in the documentation
examples.

Fixes vercel/feedback#82345
  • Loading branch information
gaojude authored Jan 21, 2025
1 parent 029a819 commit 17fc0c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/01-app/04-api-reference/04-functions/draft-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { draftMode } from 'next/headers'

export async function GET(request: Request) {
const draft = await draftMode()
draft().enable()
draft.enable()
return new Response('Draft mode is enabled')
}
```
Expand All @@ -64,7 +64,7 @@ import { draftMode } from 'next/headers'

export async function GET(request) {
const draft = await draftMode()
draft().enable()
draft.enable()
return new Response('Draft mode is enabled')
}
```
Expand All @@ -80,7 +80,7 @@ import { draftMode } from 'next/headers'

export async function GET(request: Request) {
const draft = await draftMode()
draft().disable()
draft.disable()
return new Response('Draft mode is disabled')
}
```
Expand All @@ -90,7 +90,7 @@ import { draftMode } from 'next/headers'

export async function GET(request) {
const draft = await draftMode()
draft().disable()
draft.disable()
return new Response('Draft mode is disabled')
}
```
Expand Down

0 comments on commit 17fc0c7

Please sign in to comment.