@arius tigger
yep, its all here...
https://laravel-livewire.com/docs/2.x/troubleshooting
key your for each and make sure you always have a single root div
Hi , im facing a problem, i make a livewire pagination but this pagination fails or disappear when i put another livewire component inside the loop. Hope some can help me, thanks.
Father componen main loop:
<div>
@foreach($comments as $comment)
<p class="text-xs">{{$comment->user_comment}} </p>
@endforeach
{{ $comments->links() }}
</div>
like this work like a charm, no errors and everything is ok, but when i put and otrhe componen inside it fails, like this:
<div>
@foreach($comments as $comment)
<p class="text-xs">{{$comment->user_comment}} </p>
@livewire('pages.like-button', [ 'user_id' => Auth::user()->id, 'score_id' => $comment->id ])
@endforeach
{{ $comments->links() }}
</div>
Some one can tell me why this happened or the right way to make it work? , thank you
@Arius Tigger
<div>
@foreach($comments as $comment)
<div wire:key="{{ $loop->index }}">
<p class="text-xs">{{$comment->user_comment}} </p>
@livewire('pages.like-button', [ 'user_id' => Auth::user()->id, 'score_id' => $comment->id ], key($loop->index))
</div>
@endforeach
{{ $comments->links() }}
</div>
Please or to participate in this conversation.