Skip to content

Commit 48a6ce8

Browse files
committed
fix delayed rendering
1 parent 5f927a9 commit 48a6ce8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Template/LazyTreeBuilder.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ private function pushComponent(string $name, array $attributes): void
137137
$attributes
138138
);
139139

140-
// in a weird quirk of php, this results in appending a new array to the delay stack and they are the same variable.
141-
$this->delayStackPointer = &$this->delayStack[];
142-
$this->delayStackPointer = [];
140+
// only count children we are actually rendering
141+
if(count($this->componentStack) === 1) {
142+
// in a weird quirk of php, this results in appending a new array to the delay stack and they are the same variable.
143+
$this->delayStackPointer = &$this->delayStack[];
144+
$this->delayStackPointer = [];
145+
}
143146

144147
// consume children
145148
$this->childParents[] = $this->current;

0 commit comments

Comments
 (0)