Renderhook Cannot Received Dispatched Event
Hello,
I am using a renderhook to include some custom JS on a specific page using:
The JS renders on the page correctly. I have confirmed that it renders properly using:
I cannot handle any dispatched events. I have tried:
Do I need to modify the StarJS Livewire component? What am I doing wrong?
Thanks!
2 Replies
GitHub
Cannot listen for Livewire events if component placed inside Filame...
Package Widgets Package Version v3.2.44 How can we help you? I am trying to place a Livewire component inside a Filament Widget that has inline scripts. I have this inside my Livewire Component bla...
Really appreciate the link! Unfortunately, when I add
@push('scripts')
I cannot log anything to the console. When I remove @push
, I can log the initial render
and the livewire init
. But still cannot listen for events
I switched the renderhook to PAGE_END
and now I can log to the console on load from within @push('scripts')
But still no luck with listening for events
Update: I've tried converting this to a custom page and still no luck. I can console.log
when the scripts first render but I cannot capture any events
I figured it out. I need to dispatch
from within the ->action()
of the headerAction. I was trying to dispatch from a different function. I think after
would work as well if I remember correctly. Hope this helps someone else in the future