hi
i have a Optimize question
i want to build E-commerce site
and i build that page with a list of products with pagination
i want to make livewire action on every product
what is the best why and the Optimize to make that:
- a one livewire component with a foreach loop and one
somthing like that: in a livewire component html:
@foreach ($products as $product)
livewire:click=‘dosomothing($product)’>product name<
@endforeach
** ------------------ or ------------------ **
- a foreach loop and then pass the product to a livewire component
and because of that i get a lot of components in the page
somthing like that:
@foreach ($products as $product)
@livewire(‘productpage’, [‘product’ => $product])
@endforeach
thanks