Sanity Library Reference Docs
    Preparing search index...

    Function useDialogStack

    • Beta

      Hook to register a dialog in the stack and check if it's the top-most one.

      Parameters

      • __namedParameters: { path?: Path } = {}

      Returns {
          close: (options?: { toParent?: boolean }) => void;
          dialogId: string;
          isTop: boolean;
          navigateTo: (path: Path) => void;
          stack: DialogStackEntry[];
          topEntry: DialogStackEntry;
      }

      • close: (options?: { toParent?: boolean }) => void

        Close dialogs

      • dialogId: string

        Unique ID for this dialog instance

      • isTop: boolean

        Check if this dialog is on top

      • navigateTo: (path: Path) => void

        Navigate to a specific path, updating the form path and cleaning up the stack

      • stack: DialogStackEntry[]

        The full stack of dialog entries (each has id and path)

      • topEntry: DialogStackEntry

        The current top dialog entry