No refresh component
I have the following hook when starting the panel:
The modal opens and everything works correctly. In this modal, I have a form that also creates a record correctly, and I have two events, one to close the modal and another to call another component:
This call $this->dispatch('updateTicket'); does not work.
In the component where I want this event to be called, I have the following:
`
But it does nothing. In other parts of the application, I have the same functionality and it works correctly, but I do it through an action passing the Component $livewire, and from here, I emit the event.
Why might this be happening to me?
4 Replies
Hi @Daniel Reales have you found a solution for this? I have the same issue, i have a Livewire component and i want to refresh it upon an action is complete... but it does not work.... Thanks in advance
I used that:
#[On('updateTicket')] above the function. I hope it helps you
Thanks for the reply. When you say above the function do you mean the component class or above the function executing the action? Another question with that you still need to have the "protected $listeners" or is not needed?
Again, thanks a lot for your answer.
With the new version of livewire 3 you don't need it.
https://livewire.laravel.com/docs/events#listening-for-events
Laravel
Events | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.