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

Parent clientLoader doesn't revalidate when a child route is changed #13264

Open
stevan-borus opened this issue Mar 19, 2025 · 0 comments
Open
Labels

Comments

@stevan-borus
Copy link

I'm using React Router as a...

framework

Reproduction

stackblitz repro

System Info

System:
    OS: macOS 15.3.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 216.94 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 10.5.0 - ~/Library/pnpm/pnpm
    Watchman: 2024.08.26.00 - /opt/homebrew/bin/watchman
Browsers:
    Chrome: 134.0.6998.89
    Edge: 134.0.3124.68
    Safari: 18.3.1
npmPackages:
    @react-router/dev: ^7.4.0 => 7.4.0 
    @react-router/node: ^7.4.0 => 7.4.0 
    react-router: ^7.4.0 => 7.4.0 
    vite: ^6.2.2 => 6.2.2

Used Package Manager

pnpm

Expected Behavior

The parent clientLoader should always revalidate when its child route is changed, without setting shouldRevalidate = () => true;

Actual Behavior

In the repro, v7.1.5 is set and for that version, the parent clientLoader revalidates when the child route is changed by clicking on one of the links in the parent component, so the selected link which is set in the parent clientLoader can also change

In later versions, the parent clientLoader only revalidates when shouldRevalidate is explicitly set to true
shouldRevalidate = () => true;

This is happening when ssr: false

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