Sanity Library Reference Docs
    Preparing search index...

    Function useDraftModePerspective

    • Reports the Sanity Client perspective used to fetch data in sanityFetch used on the page. If the hook is used outside Draft Mode it will resolve to 'unknown'. If the hook is used but the <SanityLive /> component is not present then it'll stay in 'checking' and console warn after a timeout that it seems like you're missing the component.

      Returns DraftPerspective

      this hook will be removed in the next major version