Skip to content

Commit

Permalink
docs(draft-mode): fix missing switcher for TS and JS codeblock (#72215
Browse files Browse the repository at this point in the history
)

The same codeblock is displayed twice.



![image](https://github.com/user-attachments/assets/01da38e1-4437-4b0a-a08e-a911bf9fea94)


![image](https://github.com/user-attachments/assets/5194faf6-7d5f-44aa-a445-21e02e635809)

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
  • Loading branch information
Juneezee and devjiwonchoi authored Nov 3, 2024
1 parent 0c14b38 commit 9409a46
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 9409a46

Please sign in to comment.