Skip to content
12 linesCodeBlameRaw
1/**
2 * When a Customize page reads its data again: for another page, the other
3 * view, or a posted form (lib/customize.ts `needsReload`). A route export
4 * the browser runs, so it lives apart from the server-only helpers.
5 */
6import type { ShouldRevalidateFunctionArgs } from "react-router";
7
8import { needsReload } from "./customize";
9
10export function shouldRevalidate({ currentUrl, nextUrl, formMethod, defaultShouldRevalidate }: ShouldRevalidateFunctionArgs): boolean {
11 return needsReload(currentUrl, nextUrl, formMethod) ? defaultShouldRevalidate : false;
12}