jonassiewertsen / statamic-livewire

A Laravel Livewire integration for Statamics antlers engine
91 stars 16 forks source link

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

Closed taylorcammack closed 1 year ago

taylorcammack commented 1 year 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 1 year 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 1 year ago

Thanks and yup, appears to be a Livewire bug