How can I use updated lifecycle hook to update multiple elements ?
Please help, am new to Livewire.
Update multiple elements with updated lifecycle hook
In the component that has updated emit an event
public function updatedPropertyName($value)
{
$this->emit('eventToListenFor');
}
Then add a listener for that event to each component that you want to update
protected $listeners = ['eventToListenFor' => 'runThisFunction'];
public function runThisFunction()
{
// Do what you need to do here!
}
1 Like
It worked, thanks Pom.
1 Like