clear-react-router 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -446,7 +446,9 @@ var createInvalidate = ({ routeDataState, loaderMap }, revalidateCache) => {
|
|
|
446
446
|
if (!routeItem) return [];
|
|
447
447
|
const pathnameSet = /* @__PURE__ */ new Set();
|
|
448
448
|
for (const [key] of loaderMap) if (comparePaths(routeItem, separatePathname(key))) pathnameSet.add(key);
|
|
449
|
-
|
|
449
|
+
const hasUnresolvedParams = separatePathname(pathname).split("/").some((segment) => segment.startsWith(":"));
|
|
450
|
+
const implicitForce = options?.force === void 0 && !options?.staleOnly;
|
|
451
|
+
if (options?.force === true || implicitForce && !hasUnresolvedParams) pathnameSet.add(pathname);
|
|
450
452
|
const currentResults = await Promise.all([...pathnameSet].map((pathname) => invalidatePath(routeItem, pathname, options)));
|
|
451
453
|
if (!options?.withChildren || !routeItem.children?.length) return currentResults;
|
|
452
454
|
const [parentPath] = pathname.split("?");
|