RepeatableEntry not updating after updating Relationship
I have a basic repeater that uses the
documents relationship like so:
But when I run an action that uploads a document, adding to the documents relationship, the repeatable entry does not update.
Am I doing something wrong?Solution:Jump to solution
Something like:
$this->dispatch('refreshData');
// In your Livewire page class...
5 Replies
I assume it shows when you refresh?
Yep
Yeah that's how info lists are because they are after, you ideally don't want them refreshing continously as it casues extra load. However, you could probably add a watcher onto it for triggered a refresh after state was updated.
Solution
Something like:
$this->dispatch('refreshData');
// In your Livewire page class
use Livewire\Attributes\On;
#[On('refreshData')]
public function refresh(): void
{
// Livewire will automatically refresh the component
}
Thanks, will give it a go