Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

beartown's avatar

Inertia redirections

Still playing around with Inertia. Now I found out that redirections cause a full page reload, which I didn't expect. Does it happen only in development mode? Or does Inertia handle redirections by just reloading a page, which would make me really surprised and disappointed? It looks terrible, as there's a flash of unstyled content happening.

0 likes
6 replies
beartown's avatar

@jaseofspades88 that's what I did. I tried to_route('foo') and all sorts of other ways, including Inertia::location(route('foo')) and back() and nothing works properly. They all cause full server-side redirection.

By the way, I'm using Inertia with React, perhaps redirections are broken with this duo?

jaseofspades88's avatar

Redirects are largely javascript agnostic, @beartown. It's likely the problem exists between the documentation and your code. I would imagine this functionality is heavily tested and operates as documented.

beartown's avatar

@jaseofspades88 I'd imagine, as it's super basic. I'm going to try to create a new app and check there. I'll get back to you once I checked. Thanks :)

beartown's avatar
beartown
OP
Best Answer
Level 2

@jaseofspades88 I figured it out! So I've been updating a JSON file in my form action and I also use this JSON file in my client-side app. That caused the hot reload! Redirections are fine, what a relief!

Please or to participate in this conversation.