Yielding content stops ajax requests

Hi All

I’m pretty new to livewire but having a play with it in Laravel 8 & am absolutley loving it!

For the past couple of days i have been using views & routing to a view for the sole purpose of returning a component. However going through the Livewire screencasts i saw that you could just route to the component instead using
@yield('content') in my app.blade file
@section('content') in my components etc.

The strange thing is since switching to that method, i can no longer submit data or see any ajax requests going to my Livewire controller component? Upon inspecting dev tools i can see that livewire styles & scripts in my layouts file are in the head & body so am a bit stumped.

I tried extending the layouts.app file in the component but no joy. Its probably going to be something painfully obvious but i think i’ve been staring too long to see the wood through the trees.

Please could someone advise where i might be going wrong?

Thank you in advance.

So you are rendering entire page via Livewire component? If not then @section bit will sort of de-attach part of your code from the component and this part will have no Livewire functionality and also will be completely ignored during re-rendering.

Basically make sure that @yield is located inside the same Livewire component otherwise this not going to work.

Ok thanks @Dimonka2 for the advice. I will give it a go.