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.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. 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
- if (options?.force === true || options?.force === void 0 && !options?.staleOnly) pathnameSet.add(pathname);
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("?");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clear-react-router",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "A lightweight routing library for React applications",
5
5
  "author": "Andrew Bubnov",
6
6
  "scripts": {