Ok great, I was equally faced with similar challenge but then I keep asking myself how can i drop Livewire just because of this little issues? and how can I not use wire:navigate because of this same issues till i was able to figure out a way.
According to the docs: https://livewire.laravel.com/docs/navigate#dont-rely-on-domcontentloaded
this event listener was suggested
document.addEventListener('livewire:navigated', () => {
// any code you place here will be fired after livewire has successfully swapped the initial page with the on you navigated to
})
Great, so in my case i was Using Flowbite so i had to copy a function from their Docs page and that was all.
document.addEventListener('livewire:navigated', () => {
// console.log('navigated to a new page');
initFlowbite();
})