jonassiewertsen / statamic-livewire

A Laravel Livewire integration for Statamics antlers engine
83 stars 14 forks source link

Dispatching events returns "Could not find Livewire component in DOM tree" #43

Closed taylorcammack closed 10 months ago

taylorcammack commented 11 months ago

Updating a template that worked in Livewire V2.

Have an Antlers template that contains a button that dispatches an event to a modal component further down the page

<button @click="$wire.$dispatchTo('modal-default', 'show', '{{ id }}')">
  View Summary
</button>

Dispatches to...

{{ livewire:modal-default view="incentives" }}

Which returns: Uncaught Could not find Livewire component in DOM tree

I know the modal is rendering on the page, because if I set the show property to it in the Livewire class, it will render. Something just seems screwy when trying to dispatch to it.

Any ideas?

marcorieser commented 11 months ago

My first approach would be to render everything via blade and have a look if it works. Maybe its a bug in Livewire itself.

taylorcammack commented 10 months ago

Thanks and yup, appears to be a Livewire bug