Skip to content

Commit 5a56e6d

Browse files
committed
fix(core): only proceed with append logic for DOMs if render state is available
1 parent 5d982f6 commit 5a56e6d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libs/core/src/lib/renderer/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,17 @@ class NgtRenderer implements Renderer2 {
191191
pRS[NgtRendererClassId.type] === 'dom' &&
192192
(newChild instanceof Text || cRS[NgtRendererClassId.type] === 'dom')
193193
) {
194-
this.store.setParent(newChild, parent);
195194
this.store.addChild(parent, newChild);
196195
this.delegate.appendChild(parent, newChild);
197-
if (this.shouldFindGrandparentInstance(pRS, cRS, newChild)) {
198-
// we'll try to get the grandparent instance here so that we can run appendChild with both instances
199-
const closestGrandparentInstance = this.store.getClosestParentWithInstance(parent);
200-
if (closestGrandparentInstance) this.appendChild(closestGrandparentInstance, newChild);
201-
return;
196+
if (cRS) {
197+
this.store.setParent(newChild, parent);
198+
if (this.shouldFindGrandparentInstance(pRS, cRS, newChild)) {
199+
// we'll try to get the grandparent instance here so that we can run appendChild with both instances
200+
const closestGrandparentInstance = this.store.getClosestParentWithInstance(parent);
201+
if (closestGrandparentInstance) this.appendChild(closestGrandparentInstance, newChild);
202+
}
202203
}
204+
203205
return;
204206
}
205207

libs/soba/staging/src/bb-anchor/bb-anchor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class NgtsBBAnchor {
5555
effect(() => {
5656
const group = this.groupRef.nativeElement;
5757
if (!group) return;
58-
console.log(group);
5958
if (group.parent?.parent) {
6059
this.parentRef.nativeElement = group.parent.parent;
6160
group.parent.parent.add(group);

0 commit comments

Comments
 (0)