What seems to be the problem:
I have a list of blocks, an ‘add block’ button and a menu to choose a block type to add to the list of blocks. I want to ignore refreshing the list of blocks until a new block has been added to the list. How can i achieve that with the code down below? wire:ignore is a nice way of stopping refreshing a part of the template, but how do i force refresh it when updated?
Steps to Reproduce:
<div>
<div wire:ignore>
@foreach($blocks as $block)
<p>{{ $block->name }}</p>
@endforeach
</div>
<button wire:click.prevent="$set('showBlockTypeMenu', true)">Add Block</button>
@if($showBlockTypeMenu)
<div>
@foreach($blockTypes as $blockTypeHandle => $blockTypeName)
<button wire:click.prevent="addBlock($blockTypeHandle)">{{ $blockTypeName }}</button>
@endforeach
</div>
@endif
</div>
Are you using the latest version of Livewire:
Yes
Do you have any screenshots or code examples:
See code above.