Self-Closing Component Tags Required in Livewire v4

Component tags must be properly closed in v4.

1 min readLivewireاقرأ بالعربية

With slot support, Livewire v4 requires properly closed component tags.

Before (v3)

blade
<!-- Worked but not recommended -->
<livewire:component-name>

After (v4)

blade
<!-- Self-closing required -->
<livewire:component-name />

<!-- Or with content -->
<livewire:component-name>
    Slot content here
</livewire:component-name>

Why?

Unclosed tags are interpreted as 
having slot content in v4.
All articles

Keep reading