I seem to be having a livewire performance issue, is this normal?
I have a form that has data for it. When I open this form the form shows up with no data then about a second later the data shows up. In my developers tools the page shows a 2 second trip to completion which seems long to me.
I’m using the mount method to populate this LW form and the elemets on the page are Livewire too.
Here is the Livewire form edit.blade.php:
<div>
<form wire:submit.prevent="edit" href="#" method="POST">
<x-input.text wire:model="tenantName" class="w-1/3 pb-4" label="Tenant" readonly />
<x-element.dropdown-db wire:model.lazy="letter_status" label="Letter Status" class="w-1/3" :selects="$letterStatus"/>
<x-input.text wire:model.lazy="name_insured" class="w-1/3 pb-4" label="Insured" placeholder="Required..." />
<x-input.text wire:model.lazy="policy" class="w-1/3 pb-4" label="Policy" placeholder="Required..." />
<x-input.text wire:model.lazy="claim" class="w-1/3 pb-4" label="Claim" placeholder="Required..." />
<div class="flex">
<x-button wire:click="submit">{{__('Submit')}}</x-button>
<x-button wire:click="next">{{__('Next')}}</x-button>
</div>
</form>
</div>
Here is the Livewire component edit.php:
public function mount()
{
(...)
$this->letterStatus = Element::grouping('LETTER_STATUS');
$this->letter_status = $data->letter_status_dataid;
$this->name_insured = $data->name_insured;
$this->policy = $data->policy;
$this->claim = $data->claim;
$this->date_of_loss = Carbon::parse($data->date_of_loss)->format(config('app.date_format'));
}
I hope this is enough information to help.