Skip to content

component x-tabuna-breadcrumbs and livewire $refresh #42

@monkeydev001

Description

@monkeydev001

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions