Component does not implement [LivewireUI\Modal\Contracts\ModalComponent] interface
saulo-arantes opened this issue · 0 comments
saulo-arantes commented
anyone can help me? im getting this error for a while and cant find where the error is
use Illuminate\View\View;
use LivewireUI\Modal\ModalComponent;
class VerFoto extends ModalComponent
{
public string $foto;
public function mount(string $foto)
{
$this->foto = $foto;
}
public function render(): View
{
return view('livewire.ver-foto');
}
}
ver-foto.blade.php
<div>
<img src="{{ $foto }}" alt="foto">
</div>
and i have this code that calls the openModal event:
<div class="p-6 cursor-pointer" onclick="Livewire.dispatch('openModal', { component: 'ver-foto', arguments: { foto: '{!! $foto !!}' } })">
<img src="{{ $foto }}" class="w-48 rounded">
</div>
and when i click on it, i get this error:
[Livewire\Volt\Component@anonymous/var/www/html/storage/framework/views/fb4c8820941014dcd9300c5855e9b00d.php:8$24b] does not implement [LivewireUI\Modal\Contracts\ModalComponent] interface.