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({
98
98
}
99
99
} , [ hasParams , isAuthenticated ] ) ;
100
100
101
+ // Show loading while checking router availability or auth/access
102
+ if ( isRouterAvailable === null || isLoading || accessLoading ) {
103
+ return < div > Loading...</ div > ;
104
+ }
105
+
101
106
// Show loading while checking router availability
102
107
if ( isRouterAvailable === null ) {
103
108
return < div > Loading...</ div > ;
@@ -108,10 +113,6 @@ export default function ProtectedRoute({
108
113
return < ProtectedRouteFallback > { children } </ ProtectedRouteFallback > ;
109
114
}
110
115
111
- if ( isLoading || accessLoading ) {
112
- return < div > Loading...</ div > ;
113
- }
114
-
115
116
if ( ! isAuthenticated ) {
116
117
return NavigateComponent ? (
117
118
< NavigateComponent to = { fallbackPath } replace />
You can’t perform that action at this time.
0 commit comments