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.
Sep 25, 2024
1
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.
Please or to participate in this conversation.