diff --git a/src/services/ComponentsService.php b/src/services/ComponentsService.php index b14b793..01443ef 100644 --- a/src/services/ComponentsService.php +++ b/src/services/ComponentsService.php @@ -309,6 +309,10 @@ public function createObject(string $component, array $variables = []): ?Compone return new SprigPlayground(['variables' => $variables]); } + if (class_exists($component)) { + return new $component(['variables' => $variables]); + } + $componentClass = self::COMPONENT_NAMESPACE . $component; if (!class_exists($componentClass)) {