Skip to content

Commit

Permalink
Set SSR stubs in render, too
Browse files Browse the repository at this point in the history
  • Loading branch information
smoores-dev committed Dec 17, 2024
1 parent 7894603 commit ab9379c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/hooks/useEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ export function useEditor<T extends HTMLElement = HTMLElement>(
[options.dispatchTransaction, options.state]
);

const cleanup = setSsrStubs();
const tempDom = document.createElement("div");
cleanup();

const docViewDescRef = useRef<NodeViewDesc>(
new NodeViewDesc(
Expand Down
2 changes: 1 addition & 1 deletion src/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ElementStub {
return new ClassList();
}
get ownerDocument() {
return new Document();
return new DocumentStub();
}
style = {};
addEventListener() {}
Expand Down

0 comments on commit ab9379c

Please sign in to comment.