-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed as not planned
Closed as not planned
Copy link
Description
I'm using React Router as a...
framework
Reproduction
Whenever React Router fetches __manifest for lazy route discovery, it also revalidates other routes unnecessarily.
Case issue:
In my app, I have a project page that functions like a video editor.
This page relies on many local states for user interactions (e.g., sliders, adjustments).
The initial values for these local states are from project page loader.
Problem:
When React Router automatically revalidates the project page router, the loader is triggered again, causing all my local states to reset. This makes the editing experience unusable, as all adjustments are lost.
// should not revalidate automatically, but in reality it still revalidated automatically.
export function shouldRevalidate() {
return false;
}
export default function Project({ loaderData }: Route.ComponentProps) {
const { something } = loaderData;
// this keep logged
console.log("loaded");
return (
<ProjectMain />
);
}System Info
System:
OS: macOS 15.3
CPU: (14) arm64 Apple M3 Max
Memory: 2.12 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v20.15.0/bin/npm
pnpm: 8.11.0 - /opt/homebrew/bin/pnpm
bun: 1.1.1 - ~/.bun/bin/bun
Browsers:
Brave Browser: 131.1.73.104
Chrome: 133.0.6943.127
Safari: 18.3
npmPackages:
@react-router/dev: ^7.2.0 => 7.2.0
@react-router/fs-routes: ^7.2.0 => 7.2.0
@react-router/node: ^7.2.0 => 7.2.0
@react-router/serve: ^7.2.0 => 7.2.0
react-router: ^7.2.0 => 7.2.0
vite: ^5.4.14 => 5.4.14Used Package Manager
npm
Expected Behavior
don't revalidate.
Actual Behavior
keep revalidating.