spiritkiddie's avatar

Livewire 4 single file component event is not working

Dispatching event in blade is never received in any order blade component listener using livewire 4 single file component.

1 like
1 reply
imrandevbd's avatar

Since Livewire 4 SFCs use an anonymous class format, listeners need to be defined inside the class definition, typically using the #[On] attribute. If you are dispatching from Blade via wire:click="$dispatch('your-event')" or $this->dispatch(), the receiving SFC needs to look like this

1 like

Please or to participate in this conversation.