Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Jan 15, 2024
1 parent 991b651 commit c4870bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export type GenericReturnType =
| null[];

// this is workaround for `if` case, where we don't have stable root, and to remove it properly we need to look into last rendered part
export const relatedRoots: WeakMap<DocumentFragment, GenericReturnType> =
new WeakMap();
export const relatedRoots: WeakMap<
DocumentFragment | HTMLElement,
GenericReturnType
> = new WeakMap();

function renderNode(parent: Node, target: Node, placeholder: Node | Comment) {
if (import.meta.env.DEV) {
Expand Down
6 changes: 5 additions & 1 deletion src/utils/ssr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { renderComponent, runDestructors, type ComponentReturnType } from '@/utils/component';
import {
renderComponent,
runDestructors,
type ComponentReturnType,
} from '@/utils/component';
import { setDocument, getDocument } from './dom-api';
import { getRoot, resetNodeCounter, resetRoot } from '@/utils/dom';

Expand Down

0 comments on commit c4870bd

Please sign in to comment.