Open ariel-codes opened 4 months ago
@ariel-codes I'm curious about how you're integrating Inertia.js with Turbo/Hotwire, as they generally aim to solve similar problems but in different ways. It's my understanding that Turbo drives navigation and partial updates without the need for a front-end framework, while Inertia integrates tightly with frameworks like Vue, React, and Svelte.
Since both manipulate the history.state
, it's understandable that there would be conflicts in scenarios where both are being used. As for Inertia, we might need a safeguard to confirm the presence of Inertia-specific data in history.state
before continuing execution.
Versions:
@inertiajs/core
version: 1.2.0@inertiajs/vue2
version: #.#.#@inertiajs/vue3
version: #.#.#@inertiajs/react
version: 1.2.0@inertiajs/svelte
version: #.#.#Describe the problem:
When navigating back/forward from pages, the router only checks that
window.history.state
is not empty, but this can conflict with other navigation frameworks (in my case Turbo/Hotwire, which useswindow.history.state.turbo
). This in turn leads to theresolve
function passed tocreateInertiaApp
being called with an undefined arg.Steps to reproduce:
window.history.state
to any truthy value before initializing Inertia