What seems to be the problem:
when i use WithPagination Trait, page url changes to /livewire/message/
Steps to Reproduce:
nested components
Are you using the latest version of Livewire:
yes
Do you have any screenshots or code examples:
What seems to be the problem:
when i use WithPagination Trait, page url changes to /livewire/message/
Steps to Reproduce:
nested components
Are you using the latest version of Livewire:
yes
Do you have any screenshots or code examples:
I had to add keys for my nested components. This is discussed in the Docs.
My navigation looks like
<a wire:click="$emitTo('main-nav', 'goToPage','crm.clients')">CRM</a>
My main nav class
protected $listeners = [
'goToPage' => 'goToPage'
];
public $page = "home";
public $key;
public $component;
public function render()
{
return view('livewire.main-nav');
}
public function goToPage($page)
{
$this->page = $page;
$this->key = time();
}
main nav blade
@livewire( $this->page, [], key($this->key))
</div>
Result when Project uses this trait use WithPagination;
`http://saas.test/livewire/message/main-nav`
Expected
http://saas.test/#projects