clear-react-router 1.4.3 → 1.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 +5 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -501,25 +501,21 @@ var Router = ({ isAnimated, animationDuration, spinner = true }) => {
501
501
  if (!location.pathname) return void 0;
502
502
  return routeList.find((el) => el.path === ALL_LOCATIONS || comparePaths(el, location.pathname));
503
503
  }, [location.pathname, routeList]);
504
- const pendingRoute = useMemo(() => {
505
- if (location.pathname) return void 0;
506
- return routeList.find((el) => comparePaths(el, window.location.pathname));
507
- }, [location.pathname, routeList]);
508
504
  const params = useMemo(() => {
509
505
  return getParamsObject({
510
- routeItem: routeItem || pendingRoute,
506
+ routeItem: routeItem || nextRouteItem,
511
507
  pathname: location.pathname || window.location.pathname
512
508
  });
513
509
  }, [
514
510
  location.pathname,
515
511
  routeItem,
516
- pendingRoute
512
+ nextRouteItem
517
513
  ]);
518
514
  const shouldErrorElementShown = useMemo(() => Boolean(loaderState[location.pathname]?.loaderError || loaderState[location.pathname]?.beforeLoadError), [loaderState, location.pathname]);
519
- if (!routeItem && !pendingRoute) return null;
520
- if (!routeItem && pendingRoute) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewProvider, {
515
+ if (!routeItem && !nextRouteItem) return null;
516
+ if (!routeItem && nextRouteItem) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewProvider, {
521
517
  params,
522
- children: renderElement(pendingRoute?.loaderFallback)
518
+ children: renderElement(nextRouteItem?.loaderFallback)
523
519
  });
524
520
  if (!isAnimated && !shouldErrorElementShown && isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewProvider, {
525
521
  params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clear-react-router",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "A lightweight, type-safe routing library for React applications",
5
5
  "author": "Andrew Bubnov",
6
6
  "scripts": {