79243737

Date: 2024-12-02 10:48:01
Score: 1.5
Natty:
Report link

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();
  })
Reasons:
  • Blacklisted phrase (0.5): how can i
  • Blacklisted phrase (0.5): how can I
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Muhammed Yakubu