clear-react-router 1.5.2 → 1.5.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 +1 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -230,7 +230,7 @@ var useHandleNavigation = ({ routeList, context, revalidateCache, setContext, is
|
|
|
230
230
|
} catch {
|
|
231
231
|
navigation(nextLocation, routeItem);
|
|
232
232
|
}
|
|
233
|
-
}, [navigation]);
|
|
233
|
+
}, [navigation, isAnimated]);
|
|
234
234
|
const navigationHandler = useCallback(async (nextLocation) => {
|
|
235
235
|
navigationSeq.current = navigationSeq.current + 1;
|
|
236
236
|
const seq = navigationSeq.current;
|
|
@@ -527,18 +527,11 @@ var renderElement = (Component) => {
|
|
|
527
527
|
return typeof Component === "function" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) : Component;
|
|
528
528
|
};
|
|
529
529
|
//#endregion
|
|
530
|
-
//#region hooks/useSetIsAnimated.ts
|
|
531
|
-
var useSetIsAnimated = (isAnimated) => {
|
|
532
|
-
const setIsAnimated = isAnimatedStore.use((state) => state.setIsAnimated);
|
|
533
|
-
useEffect(() => setIsAnimated(!!isAnimated), [isAnimated]);
|
|
534
|
-
};
|
|
535
|
-
//#endregion
|
|
536
530
|
//#region components/Router.tsx
|
|
537
531
|
var Router = ({ isAnimated, animationDuration, spinner = true, preserveScroll = true, showFallbackIfAnimated = false }) => {
|
|
538
532
|
const { routeItemData: { routeItem, loaderState }, currentLoaderFallback } = useNavigationState();
|
|
539
533
|
usePreserveScroll(preserveScroll);
|
|
540
534
|
useApplyCustomAnimation(animationDuration);
|
|
541
|
-
useSetIsAnimated(isAnimated);
|
|
542
535
|
const isLoading = Boolean(currentLoaderFallback);
|
|
543
536
|
const showErrorElement = !isLoading && Boolean(loaderState.loaderError || loaderState.beforeLoadError);
|
|
544
537
|
const showSpinner = spinner && isAnimated && isLoading;
|