Skip to content

Commit 002efc4

Browse files
authored
fix(dashboard beta): wrap the component and instead of the route (codesandbox#6040)
1 parent f9af3ed commit 002efc4

File tree

1 file changed

+9
-3
lines changed
  • packages/app/src/app/pages/Dashboard/Content

1 file changed

+9
-3
lines changed

packages/app/src/app/pages/Dashboard/Content/index.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ export const Content = withRouter(({ history }) => {
5757
})}
5858
>
5959
<Switch>
60-
{isFeatureFlagBeta && (
61-
<Route path="/dashboard/beta" component={BetaRepositoriesPage} />
62-
)}
60+
<Route
61+
path="/dashboard/beta"
62+
/**
63+
* Wrap the component instead of the whole route, as the
64+
* feature-flag query takes a few ms to load, and meanwhile the Route
65+
* redirect the page because the route hasn't been registered yet
66+
*/
67+
component={isFeatureFlagBeta ? BetaRepositoriesPage : () => null}
68+
/>
6369
<Route path="/dashboard/home" component={Home} />
6470
<Route path="/dashboard/drafts" component={Drafts} />
6571
<Route path="/dashboard/all/:path*" component={All} />

0 commit comments

Comments
 (0)