-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Lines 74 to 79 in bc046e7
{/* These are done here instead of nested so we don't flash a layout on 404s */} | |
<Route path="/orgs/:orgName" element={<Navigate to="projects" replace />} /> | |
<Route | |
path="/orgs/:orgName/projects/:projectName" | |
element={<Navigate to="instances" replace />} | |
/> |
These redirects cause us nothing but trouble. I moved them out from inside the layouts so that on a 404, we wouldn't briefly flash a layout and then go to 404. Unfortunately that means that we are flashing a blank screen instead on all navigation through the redirects, most notably navigation that actually goes somewhere! This is because we don't trigger the loader until we've rendered the route that itself renders the redirect. The simplest way to fix this is to call the loader for the target page on the redirecting <Route>
.
I don't think I noticed this initially because the mock API server is almost instantaneous, whereas real Nexus is not quite that. The dev server needs an artficial delay.