-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Description
I'm using React Router as a...
framework
Reproduction
https://github.com/lukejagodzinski/rr-should-revalidate-repro
- Run
npm run dev - Open app in the browser
- Open "Network" tab in the browser dev tools
- Click the "Use fetcher" button to call action using fetcher
- Observe that the request is made and 422 response is returned and the unnecessary revalidation is triggered. This should not happen according to docs.
- Click the "Use form submit" button to call the same action but using regular form submission
- Observe that the request is made and 422 response is returned but the revalidation is not triggered. This is the expected behavior.
You can also fix the issue by uncommenting the shouldRevalidate function in app/routes/home.tsx:14. However, that should not be necessary.
System Info
System:
OS: macOS 15.1.1
CPU: (10) arm64 Apple M1 Max
Memory: 9.68 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
bun: 1.0.28 - ~/.bun/bin/bun
Browsers:
Chrome: 133.0.6943.99
Safari: 18.1.1
npmPackages:
@react-router/dev: ^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.11 => 5.4.14Used Package Manager
npm
Expected Behavior
RR shouldn't revalidate loaders when action returning error is being called using fetcher
Actual Behavior
RR revalidates loaders after action returning error is being called using fetcher
brophdawg11 and okalil