Optional
actionWhen a submission causes the revalidation this will be the result of the action—either action data or an error if the action failed. It's common to include some information in the action result to instruct shouldRevalidate to revalidate or not.
Optional
actionThe status code of the action response
These are the dynamic route params from the URL that can be compared to the nextParams
to decide if you need to reload or not. Perhaps you're using only a partial piece of the param for data loading, you don't need to revalidate if a superfluous part of the param changed.
This is the url the navigation started from. You can compare it with nextUrl
to decide if you need to revalidate this route's data.
By default, React Router doesn't call every loader all the time. There are reliable optimizations it can make by default. For example, only loaders with changing params are called. Consider navigating from the following URL to the one below it:
/projects/123/tasks/abc /projects/123/tasks/def React Router will only call the loader for tasks/def because the param for projects/123 didn't change.
It's safest to always return defaultShouldRevalidate after you've done your specific optimizations that return false, otherwise your UI might get out of sync with your data on the server.
Optional
formThe form action (<Form action="/somewhere">
) that triggered the revalidation.
Optional
formThe form submission data when the form's encType is application/x-www-form-urlencoded
or multipart/form-data
Optional
formThe form encType (`
Optional
formThe method (probably "GET"
or "POST"
) used in the form submission that triggered the revalidation.
Optional
jsonThe form submission data when the form's encType is application/json
In the case of navigation, these are the dynamic route params from the next location the user is requesting. Some revalidations are not navigation, so it will simply be the same as currentParams.
In the case of navigation, this the URL the user is requesting. Some revalidations are not navigation, so it will simply be the same as currentUrl.
Optional
textThe form submission data when the form's encType is text/plain
Arguments passed to shouldRevalidate function