breadcrumbs icon indicating copy to clipboard operation
breadcrumbs copied to clipboard

component x-tabuna-breadcrumbs and livewire $refresh

Open monkeydev001 opened this issue 8 months ago • 0 comments

Hi. I am using a Livewire component

namespace App\Livewire\Admin;
use Livewire\Component;

class Breadcrumbs extends Component
{
    protected $listeners = [
        'refresh-breadcrumbs' => '$refresh',
    ];
    public function render()
    {
        return view('livewire.breadcrumbs');
    }
}

and and <x-tabuna-breadcrumbs> inside view:

    <div class="max-w-12xl mx-auto py-2 px-4 sm:px-6 lg:px-8 d-flex align-items-center">
        <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
            <ol class="breadcrumb mb-0">
                <x-tabuna-breadcrumbs class="breadcrumb-item" active="active"/>
            </ol>
        </nav>
    </div>

When page rendered first time all breadcrumbs shown successfully, but then I dispatch event refresh-breadcrumbs the content of <ol> tags returned empty. It because in refresh moment component detected route livewire.update and couldn't detect a right route of page. Can you help to understand how to fix it?

monkeydev001 avatar Jun 10 '24 14:06 monkeydev001