Load custom component inside action modal

Ok I think I'm missing something obvious here, but is there a way to load a custom Livewire component inside a modal action?

Here's an example of what I've tried

use Filament\Infolists\Components\Actions\Action;

Action::make('something')
    // ->modalContent(view('livewire.my-modal')) // This doesn't work either since it's just the view
    ->livewire(new MyCustomComponent())

but it doesn't work (the modal is empty)

This is what my component looks like

class MyCustomComponent extends Component implements HasActions, HasForms, HasTable
{
    use HasTabs;
    use InteractsWithActions;
    use InteractsWithForms;
    use InteractsWithTable {
        makeTable as makeBaseTable;
    }

    public function mount(): void
    {
      ...
    }

    public function render(): View
    {
        return view('livewire.my-modal');
    }
}
Solution
->modalContent(fn (): Htmlable => new HtmlString(Blade::render('@livewire(\'my-modal\')')))

?
Was this page helpful?