From fa7d26b0a7e80f539db372d1cebfedbadda74335 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Wed, 21 May 2025 08:52:58 +0100 Subject: [PATCH] Update ViewComponent.php --- packages/support/src/Components/ViewComponent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/support/src/Components/ViewComponent.php b/packages/support/src/Components/ViewComponent.php index 8d4944f754..08afa0ef48 100644 --- a/packages/support/src/Components/ViewComponent.php +++ b/packages/support/src/Components/ViewComponent.php @@ -30,9 +30,9 @@ abstract class ViewComponent extends Component implements Htmlable /** * @param view-string | null $view - * @param array $viewData + * @param array | Closure $viewData */ - public function view(?string $view, array $viewData = []): static + public function view(?string $view, array | Closure $viewData = []): static { if ($view === null) { return $this; @@ -40,7 +40,7 @@ abstract class ViewComponent extends Component implements Htmlable $this->view = $view; - if ($viewData !== []) { + if (filled($viewData)) { $this->viewData($viewData); }