PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Unsolved

Trigger a refresh of a Volt main component from within a nested Livewire component

booltje124

Jun 13th, 2025 07:29 AM

Hi!

I'm using a Volt componend with a nested Livewire component inside. I’d like to refresh (or re-render) the main Volt component when an action occurs in the nested component. What’s the best way to achieve this?

Section::make('deals')
                        ->heading(false)
                        ->schema([
                            Tabs::make('Tabs')
                                ->tabs([
                                    Tabs\Tab::make('Deals')
                                        ->badge(function (Project $record) {
                                            return $record->countDeals();
                                        })
                                        ->icon('phosphor-handshake-fill')
                                        ->schema([
                                            \Filament\Infolists\Components\Livewire::make(DealsTable::class,
                                                ['project' => $this->project])->key('deals-table')
                                        ]),

In the volt component i use this code to update the livewire component:

$this->dispatch('refresh-data')->to(DealsTable::class);

#[On('refresh-data')] 

But the other way around does not work...

bobbyiliev

Jun 16th, 2025 12:00 AM

I think that to refresh a Volt component from a nested Livewire component, I believe you should be able to dispatch an event from the nested component and listen for it in the Volt component:

So in your nested DealsTable component:

// Try dispatching an event to the parent
$this->dispatch('refresh-volt-component');

Then in your Volt component:

#[On('refresh-volt-component')]
public function refreshComponent()
{
    // This should re-render the component
    $this->render();
    
    // Or you might need to refresh specific data:
    // $this->project = $this->project->fresh();
}

Alternatively, you could try using $refresh to trigger a complete component refresh:

#[On('refresh-volt-component')]
public function refreshComponent()
{
    $this->js('$wire.$refresh()');
}

I think the key is that Volt components should listen for events the same way as regular Livewire components using the #[On('event-name')] attribute. You might need to experiment with the exact syntax or check if there are any Volt-specific approaches.

Let me know how it goes!