Skip to content

Commit 9319ae4

Browse files
authored
fix(app): fix ODD current run redirect whitescreen (#15753)
wraps the ODD current run redirect Route in a Routes component to fix the whitescreen error "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>." Moves the TopLevelRedirects component inside of the ErrorBoundary to avoid whitescreens (though reload would still trigger the error boundary in this case)
1 parent 7fd60af commit 9319ae4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/App/OnDeviceDisplayApp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ export const OnDeviceDisplayApp = (): JSX.Element => {
201201
</>
202202
)}
203203
</Box>
204+
<TopLevelRedirects />
204205
</ErrorBoundary>
205-
<TopLevelRedirects />
206206
</OnDeviceLocalizationProvider>
207207
</InitialLoadingScreen>
208208
</ApiHostProvider>
@@ -275,7 +275,9 @@ export function OnDeviceDisplayAppRoutes(): JSX.Element {
275275
function TopLevelRedirects(): JSX.Element | null {
276276
const currentRunRoute = useCurrentRunRoute()
277277
return currentRunRoute != null ? (
278-
<Route element={<Navigate to={currentRunRoute} />} />
278+
<Routes>
279+
<Route path="*" element={<Navigate to={currentRunRoute} />} />
280+
</Routes>
279281
) : null
280282
}
281283

0 commit comments

Comments
 (0)