Illuminate\View\DynamicComponent::compileSlots(): Argument #1 ($slots) must be of type array, null given, called in .../vendor/illuminate/view/DynamicComponent.php on line 76
Getting the above error when using components. In our theme we have
<x-dynamic-component :component="'banner.' . $bannerType" />
and pass the $bannerType in Components class like the below
public function __construct()
{
$this->bannerType = $this->getBannerType();
}
public function getBannerType()
{
$field = get_field('banner_type');
if ($field) {
return $field;
}
return false;
}
Not sure why we are getting this error as we are copying another we’ve built and it works fine in the other site.
Any help/suggestions as to why we may be getting this error is much appreciated.