FilamentF
Filament3y ago
Abi

Utility Injection on action method not working

does utility injection work on Action's action method?
when I try Action::icon('some-icon')->action(function (Livewire $livewire, $state) { I get the following error
Argument #1 ($livewire) must be of type Livewire\Livewire, Edit{Resource}Page given
called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
Solution
Should be ‘Component’ not ‘Livewire. You’re using the wrong class.
Was this page helpful?