SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function useStudioApp

    • Single-call setup for a single-per-window Studio app: resolves what to open (an explicit StudioAppOptions.source, the ?source URL query, or a blank workbook) and manages the window chrome — document/tab title (with an unsaved ● marker), an unsaved-changes close prompt, and a browser keyboard guard.

      Parameters

      Returns StudioProps

      the <Studio> props: every Studio prop given in options, plus workbook (the value to open) and the onWorkbookChange / onDirtyChange / onWorkbookLoad callbacks the studio fires as it opens/replaces workbooks, so the chrome follows (yours are chained after the hook's).

      Studio owns the workbook lifecycle (resolve, Open/replace, save, dirty tracking) and reports the live workbook + dirty flag via the callbacks; this hook holds them only to drive the window chrome (the workbook itself carries its name/origin). For apps that own the whole window — NOT for embedding Studio as a widget (which must not touch the window title / beforeunload of its host).

      const studioApp = useStudioApp({ startWith: 'welcome', propsWorkbook: { … } });   // reads ?source, else a blank workbook
      return <Studio {...studioApp} />;