Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstdmstd's avatar

I got errors with wire:key in custom component ?

What is the difference in calling livewire component with different syntax in laravel 10 / livewire 3 app :

    @livewire('trix', ['value' => 'Default value', 'hidden' => true, 'trixId' => 'fakeEditor', "wire:key"=>"fakeEditor"])

and

    <livewire:trix value = "Default value" hidden = "true" trixId = "fakeEditor" wire:key="fakeEditor" />

First code works ok for me, but wire:key is not applied in this case, as I got

    Snapshot missing on Livewire component with id

error. The second syntax breaked my page (all next output is missing) and I do not see why...

How correctly to use wire:key in my case ?

0 likes
1 reply
mstdmstd's avatar

looks like using <livewire:trix syntax there must be NO space between key, equal sigh and value inside "". Strange issue

Please or to participate in this conversation.