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.
- package/dist/index.js +5 -9
- 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 ||
|
|
506
|
+
routeItem: routeItem || nextRouteItem,
|
|
511
507
|
pathname: location.pathname || window.location.pathname
|
|
512
508
|
});
|
|
513
509
|
}, [
|
|
514
510
|
location.pathname,
|
|
515
511
|
routeItem,
|
|
516
|
-
|
|
512
|
+
nextRouteItem
|
|
517
513
|
]);
|
|
518
514
|
const shouldErrorElementShown = useMemo(() => Boolean(loaderState[location.pathname]?.loaderError || loaderState[location.pathname]?.beforeLoadError), [loaderState, location.pathname]);
|
|
519
|
-
if (!routeItem && !
|
|
520
|
-
if (!routeItem &&
|
|
515
|
+
if (!routeItem && !nextRouteItem) return null;
|
|
516
|
+
if (!routeItem && nextRouteItem) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewProvider, {
|
|
521
517
|
params,
|
|
522
|
-
children: renderElement(
|
|
518
|
+
children: renderElement(nextRouteItem?.loaderFallback)
|
|
523
519
|
});
|
|
524
520
|
if (!isAnimated && !shouldErrorElementShown && isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewProvider, {
|
|
525
521
|
params,
|