From e92417f3abbdba65abcbc597796968a0795ba8a1 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Fri, 19 May 2023 11:17:16 +0200 Subject: [PATCH] docs(routeprogressbar): clarify key usage --- src/app/layout/progressbar/RouteProgressBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/layout/progressbar/RouteProgressBar.tsx b/src/app/layout/progressbar/RouteProgressBar.tsx index 8dd26939..bf728fba 100644 --- a/src/app/layout/progressbar/RouteProgressBar.tsx +++ b/src/app/layout/progressbar/RouteProgressBar.tsx @@ -12,6 +12,7 @@ export const RouteProgress = () => { const location = useLocation(); const isLoading = navigation.state === LOADING_STATE; // key is used to reset the state of the progress when location changes + // cannot use location.key directly since that will cancel the animation early (key and isLoading are updated at the same time) const [keyIncrement, setKeyIncrement] = React.useState(0); React.useEffect(() => { @@ -49,7 +50,6 @@ export const RouteProgressBar = ({ isLoading }) => { }; const ProgressBar = ({ progress }: { progress: number }) => { - console.log({ progress }); return (