Button disappears after click

I am experimenting with Livewire and I have a weird problem, after i click the button it disappears completely and the variable is duplicated.


public $debugVariable = 1;

public function test()
    $this->debugVariable = 12;

public function render()
    return view('livewire.view');


{{ $debugVariable }}

<button type="button" wire:click="test">Click</button>

After I click the button it disappears and the output is

1 12

Wrapping the view content in a div solved the issue.

You must always have a single root element in the view