How to opt-in to old shouldRevalidate behavior with single fetch? #10382
Replies: 2 comments
-
The Single Fetch flag is what cause this, the only way to get the old behavior is to either disable Single Fetch (but then you won't be able to migrate to RR as that's the only behavior supported there) or use shouldRevalidate yourself to control it. Another way would be to let loaders run again, but cache the data server-side so you keep returning the same cached data fast, this will work with and without Single Fetch. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've decided to open up a proposal. Please see here: #10398 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working toward migrating to single fetch and react router v7 which changes the validation behavior on navigation. Now if you navigate to a child route, all parent routes are revalidated instead of just the new child routes. We built our application to take advantage of hierarchical routes and prevent unnecessary loading when navigating. Is there an easy way to use the old behavior?
I don't want to write a custom shouldRevalidate for every single route, but I'm worried that's the approach I have to take...something that takes in the route defining the shouldRevalidate function and determines if the navigation is a child path or not.
It would be nice and make this much easier if
ShouldRevalidateFunctionArgs
contained adefaultShouldRevalidateLegacy
property that could be used.Beta Was this translation helpful? Give feedback.
All reactions