Skip to content

Commit f391411

Browse files
committed
Initialize Livewire error bag in Comments component mount method
1 parent ccead12 commit f391411

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Livewire/Comments.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class Comments extends Component
2626
'commentBody' => 'required|string',
2727
];
2828

29+
public function mount(): void
30+
{
31+
// Ensure the Livewire error bag is initialized to avoid null in views
32+
$this->resetErrorBag();
33+
}
34+
2935
#[Renderless]
3036
public function save()
3137
{

0 commit comments

Comments
 (0)