Vizel API / core/src / mountVizelEditorView
Function: mountVizelEditorView()
ts
function mountVizelEditorView(editor, container): () => void;Defined in: packages/core/src/utils/editorHelpers.ts:28
Mount a Tiptap editor's view.dom into a container element and return a disposer that removes it.
Each framework's VizelEditor component previously hand-wrote the same three-step pattern:
container.appendChild(editor.view.dom)editor.view.setProps({ editable: () => editor.isEditable })- Cleanup that removes the DOM only if it is still parented to
container(so swapping the editor or container does not yank a node that has already been re-parented elsewhere).
Lifting this into core keeps the three adapters as thin lifecycle wrappers and ensures behavior parity across React, Vue, and Svelte.
Parameters
| Parameter | Type |
|---|---|
editor | Editor |
container | HTMLElement |
Returns
A disposer that detaches the editor view from the container.
() => void