Accessing (parent?) data using <x-filament::button

Hi, I am trying to use <x-filament::button within a blade file I've created. I have a state property which is an array. Below I have two buttons:
<!-- native button -->
<button wire:click.prevent="dispatchFormEvent('calendarField:reset', state)">
Test
</button>

<!-- filament button -->
<x-filament::button color="danger" icon="heroicon-o-x-mark" tag="button" type="submit" size="xs" wire:click.prevent="dispatchFormEvent('calendarField:reset', state)">
Reset
</x-filament::button>
<!-- native button -->
<button wire:click.prevent="dispatchFormEvent('calendarField:reset', state)">
Test
</button>

<!-- filament button -->
<x-filament::button color="danger" icon="heroicon-o-x-mark" tag="button" type="submit" size="xs" wire:click.prevent="dispatchFormEvent('calendarField:reset', state)">
Reset
</x-filament::button>
The standard syntax button works perfectly and executes calendarField:reset and passes the state to it. However, <x-filament::button does not and gives the error ReferenceError: state is not defined I've tried using $parent.state to no avail. Any ideas? Thanks!
2 Replies
fagner
fagner3mo ago
Hey man, you resolve this ? i have the same problem
awcodes
awcodes3mo ago
Where is ‘state’ defined?
Want results from more Discord servers?
Add your server