Laravel React Inertia | when client open it from browser history it open JSON return not a component
i have problem with all Inertia Projects
when the user open the page from his browser history
it open a JSON not a react page
how can i prevent this
i have
which part exacly
it is a big project
i added this code
public function handle(Request $request, \Closure $next)
{
$response = parent::handle($request, $next);
How did you configure Inertia? How are you navigating between pages? There's something wrong with the setup or how you're using Inertia if you see JSON responses through the browser history. Without seeing any code, it's hard to say what's wrong. I've never seen that myself.
That middleware is unnecessary and does nothing when you're navigating from history, since the X-Inertia header is only present in XHR requests sent by Inertia.