@qirtaas/react wraps @qirtaas/core’s mount API in two
components: <QirtaasEditor> and <QirtaasRenderer>. The editor itself is a
self-contained island that core bundles in — your React app does not need Vue
installed, and only React is a peer dependency.
QirtaasEditor
Props
Props mirrorEditorMountOptions, plus the
connection config (the wrapper creates its client internally):
() => Promise<string> | string
required
Returns a short-lived embed token. Called on init, before expiry, and on
401. See Authentication.string
default:"https://api.qirtaas.io"
Qirtaas API base URL.
string
Existing document to load. Omit to lazy-create on first edit
(
onDocumentCreated delivers the new id).Json | null
Initial content (TipTap JSON) when not loading from a
documentId."en" | "ar"
"light" | "dark"
boolean
default:"false"
boolean
AutosaveOptions
See Types. Set
{ enabled: false } and call
save() on the ref to drive persistence yourself.onReady, onChange, onSaveStateChange,
onDocumentCreated, onError, onTokenExpired, onEvent) match the
editor callbacks one-to-one. Always the latest render’s
callbacks are invoked — capturing state in them is safe.
Live updates vs. remount
The component mounts the editor once. Only two props are live after mount:theme— forwarded tosetThemereadOnly— forwarded tosetEditable
documentId, getToken, locale, …) requires a
remount — give the component a key that changes with them:
The mount effect is StrictMode-safe: the dev-mode double invoke fully tears
down and cleanly re-mounts.
Ref handle (QirtaasEditorHandle)
Json | null
Current editor content (TipTap JSON).
Promise<void>
Force an immediate save of pending changes.
void
void
QirtaasRenderer
Read-only display. Supply exactly one auth source —shareToken,
getToken, or getSignature (see Renderer auth modes).
Props
string
default:"https://api.qirtaas.io"
string
Document to render. With
shareToken, the token resolves the document.Public read.
() => Promise<string> | string
Own-document read (embed token).
() => Promise<{ signature: string; exp: number }>
Cross-user read (per-document HMAC signature).
"en" | "ar"
"light" | "dark"
onReady, onError. Ref handle (QirtaasRendererHandle) exposes
setTheme(theme). As with the editor, only theme is live — remount (via
key) for anything else.
