Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shouldRevalidate false keep revalidating whenever __manifest is fetched #13079

Open
devnomic opened this issue Feb 21, 2025 · 0 comments
Open
Labels

Comments

@devnomic
Copy link

devnomic commented Feb 21, 2025

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.14

Used Package Manager

npm

Expected Behavior

don't revalidate.

Actual Behavior

keep revalidating.

@devnomic devnomic added the bug label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant