fix: Set isInitialized to force immediate react node view rendering

This commit is contained in:
Arek Nawo
2026-01-08 22:51:28 +01:00
parent cfbaedcd63
commit 601ed88931
15 changed files with 562 additions and 554 deletions
@@ -44,7 +44,7 @@ export const Subpages = Node.create<SubpagesOptions>({
mergeAttributes(
{ "data-type": this.name },
this.options.HTMLAttributes,
HTMLAttributes,
HTMLAttributes
),
];
},
@@ -63,6 +63,9 @@ export const Subpages = Node.create<SubpagesOptions>({
},
addNodeView() {
// Force the react node view to render immediately using flush sync (https://github.com/ueberdosis/tiptap/blob/b4db352f839e1d82f9add6ee7fb45561336286d8/packages/react/src/ReactRenderer.tsx#L183-L191)
this.editor.isInitialized = true;
return ReactNodeViewRenderer(this.options.view);
},
});