Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(draft-mode): fix missing switcher for TS and JS codeblock #72215

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/02-app/02-api-reference/04-functions/draft-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ related:

`draftMode` is an **async** function allows you to enable and disable [Draft Mode](/docs/app/building-your-application/configuring/draft-mode), as well as check if Draft Mode is enabled in a [Server Component](/docs/app/building-your-application/rendering/server-components).

```tsx filename="app/page.ts"
```tsx filename="app/page.ts" switcher
import { draftMode } from 'next/headers'

export default async function Page() {
const { isEnabled } = await draftMode()
}
```

```jsx filename="app/page.js"
```jsx filename="app/page.js" switcher
import { draftMode } from 'next/headers'

export default async function Page() {
Expand Down Expand Up @@ -101,7 +101,7 @@ Then, send a request to invoke the Route Handler. If calling the route using the

You can check if Draft Mode is enabled in a Server Component with the `isEnabled` property:

```tsx filename="app/page.ts"
```tsx filename="app/page.ts" switcher
import { draftMode } from 'next/headers'

export default async function Page() {
Expand All @@ -115,7 +115,7 @@ export default async function Page() {
}
```

```jsx filename="app/page.js"
```jsx filename="app/page.js" switcher
import { draftMode } from 'next/headers'

export default async function Page() {
Expand Down
Loading