Livewire wire:navigate loading multiple instances of livewire etc

Using the “wire:navigate” creates this weird bug that happens to re-initiate livewire and alpine all the time you press on a link w said attribute.

Have used this guide to implement livewire (+ generating the key):

Acorn 4.2.2
livewire 3.4

this is my functions.php:


Register Livewire 3

collect([‘wp_head’ => ‘@livewireStyles’,
‘wp_footer’ => ‘@livewireScriptConfig’,
])->each(fn ($directive, $hook) =>
add_action($hook, function () use ($directive) {
echo Illuminate\Support\Facades\Blade::render($directive);

wire:navigate will typically only work with Laravel routes, not WordPress posts/pages.

If you are using Laravel routes, then I’d try what @niznet suggested in the other thread and manually bundle Livewire/Alpine instead of using the Directives.

hmm, crazy I could’ve sworn that it seems to work, just loading up everything twice or x2 whenever I make use of it…

so going from x2, 4x, x8 etc.

I ll look into @niznet solution, thanks