Skip to content

Commit

Permalink
[TwigComponent] Dispatch PostRenderEvent when component is embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Sep 24, 2023
1 parent b6f4d39 commit 3a83d87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/TwigComponent/src/ComponentRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ public function embeddedContext(string $name, array $props, array $context, stri

public function finishEmbeddedComponentRender(): void
{
$this->componentStack->pop();
$mounted = $this->componentStack->pop();

$event = new PostRenderEvent($mounted);
$this->dispatcher->dispatch($event);
}

private function preRender(MountedComponent $mounted, array $context = []): PreRenderEvent
Expand Down

0 comments on commit 3a83d87

Please sign in to comment.