mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
11 lines
273 B
TypeScript
11 lines
273 B
TypeScript
import { use } from "react";
|
|
import { draftMode, type UnsafeUnwrappedDraftMode } from 'next/headers';
|
|
|
|
export function MyComponent2() {
|
|
(draftMode() as unknown as UnsafeUnwrappedDraftMode).enable()
|
|
}
|
|
|
|
export function useDraftModeEnabled() {
|
|
use(draftMode()).enable()
|
|
}
|