wire:click result in an exception

Hi, I have a problem with a custom livewire component.

My button:
<button wire:click="nextReportStep" class="bttn-2">Weiter</button>

And this function in my class:
public function nextReportStep(): void
{
    $this->reportStep++;
}


Result in this:
Alpine Expression Error: undefined
Expression: "$wire.nextReportStep"

Uncaught String {'Could not find Livewire component in DOM tree', el: button.bttn-2, expression: '$wire.nextReportStep'}
Was this page helpful?