Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amir5's avatar
Level 7

Can't update property inside of updatingX or updatedX livewire hook

I want to update search results array when query changes, so:

public array $results;
public string $query;

public function updatingQuery($value) {
	$this->results = ..
}

But after updatingQuery called, livewire throws exception of Livewire encountered corrupt data when trying to hydrate a component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests..

no matter I use updating or updated.

The only way to make it work is to calculate results in render method without having any property, but I only want to update the results if the query has changed, not every time the component rerenders.

0 likes
1 reply
amir5's avatar
Level 7

I solved it by putting search selects to their components which they can use render to render results, then dispatch event to set value to parent.

Please or to participate in this conversation.