I'm currently using Laravel 12 with Livewire 3, and I was previously a long-time user of Livewire 2.
In Livewire 2, I commonly used Blade @if(...) to conditionally mount components based on state or user roles. However, after switching to Livewire 3, I’m adjusting to the new lifecycle behavior — especially how conditionals like @if($isFormShow) unmount the component entirely, which breaks things like event listening or dispatch.
Now I understand that in Livewire 3, we should favor wire:show to preserve component mounting and state. For example:
<div wire:show="{{ $isFormShow }}">
<livewire:dev.form-add />
</div>
But in some cases, I still want to use conditionals that don't depend on reactive state, such as:
@if(auth()->user()->hasRole('super-user'))
<livewire:admin.panel />
@endif
@if($user->email_verified)
<livewire:verified-panel />
@endif
These are static conditions that won’t change during the request lifecycle, and I don’t want to trigger unnecessary re-renders or server calls just to toggle them.
I'm also considering moving these kinds of condition checks into the child component, like:
{{-- Inside <livewire:form-add /> --}}
@if(auth()->user()->hasRole('super-user'))
<div>Only for super users</div>
@endif
This works well when I need the component to remain mounted (e.g. to receive dispatch() events).
My Questions:
For static conditions like user role or email verification, is it still best practice to use Blade @if(...) in the parent view?
When is it more appropriate to move conditionals into the child component instead?
Is wire:show meant only for UI-level visibility toggling, rather than mounting logic?
Are there performance trade-offs or lifecycle issues I should be aware of between these approaches?
Thank you for the answer and help in advance.