Livewire v3 removed emit and dispatchBrowserEvent in favor of using a single dispatch method. Check the upgrade guide.
Sep 5, 2023
5
Level 1
livewire dispatchBrowserEvent function does not exist
I am tring to show alert message of javascript through livewire component public function render() { $this->dispatchBrowserEvent('alert', ['type' => 'success', 'message' => 'User Created Successfully!']); } I gives error Method App\Livewire\Alert::dispatchBrowserEvent does not exist. In resources\views\components\layouts\app.blade.php @livewireScripts doucment.addEventListener('alert', function() { alert('this is alert from component '); });
Level 15
3 likes
Please or to participate in this conversation.