Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

veptune's avatar

Hook element.updated not received

Hello,

I need to do some JS everytime the component is re-rendered. So I wrote it in my compent :

 // Call the initDataTable function when the page loads
        document.addEventListener('DOMContentLoaded', function () {

            console.log("DOMContentLoaded");

            // Hook pour Livewire 3 : Après que Livewire ait fini de mettre à jour le DOM
            Livewire.hook('element.updated', (el, component) => {
                
                console.log("element.updated");

            });


        });

But the hook is never called (DOMContentLoaded' is)

I use Livewire 3

Any idea?

Thx

0 likes
0 replies

Please or to participate in this conversation.