File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/components/react-router-dom Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ export default function ProtectedRoute({
9898 }
9999 } , [ hasParams , isAuthenticated ] ) ;
100100
101+ // Show loading while checking router availability or auth/access
102+ if ( isRouterAvailable === null || isLoading || accessLoading ) {
103+ return < div > Loading...</ div > ;
104+ }
105+
101106 // Show loading while checking router availability
102107 if ( isRouterAvailable === null ) {
103108 return < div > Loading...</ div > ;
@@ -108,10 +113,6 @@ export default function ProtectedRoute({
108113 return < ProtectedRouteFallback > { children } </ ProtectedRouteFallback > ;
109114 }
110115
111- if ( isLoading || accessLoading ) {
112- return < div > Loading...</ div > ;
113- }
114-
115116 if ( ! isAuthenticated ) {
116117 return NavigateComponent ? (
117118 < NavigateComponent to = { fallbackPath } replace />
You can’t perform that action at this time.
0 commit comments