How To Use Turbolinks in Livewire 2
Mar 10, 2021
Livewire no longer supports Turbolinks out of the box.
If you want to continue using Turbolinks in your Livewire application, you will have to include the Turbolinks adapter alongside Livewire’s JavaScript assets:
- Add the
turbolinks
package to your application:
npm install --save turbolinks
2. Require and start Turbolinks in your JavaScript bundle:
open : resource/js/app.js
Var Turbolinks = require("turbolinks)
Turbolinks.start()
3. Add Turbolinks adapter to layout :
...
@livewireScripts
<script src="https://cdn.jsdeliver.net/gh/livewire/turbolinks@v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false"></script>