Skip to content

Pre-rendered SPA route not re-loadedΒ #13142

@namoscato

Description

@namoscato

I'm using React Router as a...

framework

Reproduction

  1. Open StackBiltz project
  2. Click "Page 1" link
  3. Refresh page
  4. Click "Next"
  5. See that page navigates to /2, but component does not re-load

System Info

System:
  OS: Linux 5.0 undefined
  CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 18.20.3 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 10.2.3 - /usr/local/bin/npm
  pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
  @react-router/dev: * => 7.2.0 
  @react-router/node: * => 7.2.0 
  @react-router/serve: * => 7.2.0 
  react-router: * => 7.2.0 
  vite: ^6.0.11 => 6.2.0

Used Package Manager

npm

Expected Behavior

SPA transitions between the same pre-rendered route with updated params should re-invoke the route's loader and re-render the route component with the new loader result.

Actual Behavior

While the URL updates as expected, the pre-rendered route is re-rendered with the first page's loader data.

This seems to be scoped to pre-rendered routes in SPA mode (ssr: false) with a loader function, and it seemed to regress around v7.2.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions