Reputation: 351
I do not know what I am missing but I followed every step but it does not rerender the view.
Here's my livewire component class:
use Livewire\Component;
class HelloWorld extends Component
{
public $message = 'Hello, world!';
public function render()
{
return view('livewire.hello-world');
}
}
Here's the livewire view:
<input type="text" wire:model="message">{{ $message }}
When I type in the input box, I see XHR requests being sent but the view does not update. What am I missing here? I have been looking around for answers for few hours already.
Upvotes: 4
Views: 4687
Reputation: 1
You need to have a root elememt. note that you can have only one root element.
Upvotes: 0
Reputation: 54
Your blade view must have only one root element and it should looks like below :
<div>
<input type="text" wire:model="message">{{ $message }}
</div>
Upvotes: 0