© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
bwurtz999

Renderhook Cannot Received Dispatched Event

Hello,

I am using a renderhook to include some custom JS on a specific page using:

FilamentView::registerRenderHook(
            PanelsRenderHook::BODY_START,
            fn (): string => Blade::render('@livewire(\'star-j-s\')'),
            scopes: [
                ListOrders::class,
            ]
        );
FilamentView::registerRenderHook(
            PanelsRenderHook::BODY_START,
            fn (): string => Blade::render('@livewire(\'star-j-s\')'),
            scopes: [
                ListOrders::class,
            ]
        );


The JS renders on the page correctly. I have confirmed that it renders properly using:

<div>
</div>

<script>
  console.log('rendered');
</script>
<div>
</div>

<script>
  console.log('rendered');
</script>


I cannot handle any dispatched events. I have tried:

document.addEventListener('livewire:init', () => {
        Livewire.on('paymentSuccessful', event => {
})
// and ...
$wire.on('paymentSuccessful') // this throws an error saying $wire is undefined
// and...
window.addEventListener('paymentSuccessful', event => {

})
document.addEventListener('livewire:init', () => {
        Livewire.on('paymentSuccessful', event => {
})
// and ...
$wire.on('paymentSuccessful') // this throws an error saying $wire is undefined
// and...
window.addEventListener('paymentSuccessful', event => {

})


Do I need to modify the StarJS Livewire component? What am I doing wrong?

Thanks!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

dispatched event not being listened to
FilamentFFilament / ❓┊help
11mo ago
Test Livewire assertDispatched and assertSee after event dispatched
FilamentFFilament / ❓┊help
2y ago
hook into notification received event
FilamentFFilament / ❓┊help
2y ago
Returning Action in renderHook
FilamentFFilament / ❓┊help
8mo ago