Skip to content

Commit 78d2f28

Browse files
ref(routes): Prioritize customer domains route (#70451)
In a936fb0 we introduced a new withOrgPath prop to the Route component. This caused the route to have the same behaviour as doing ```tsx <Framgnet> {USING_CUSTOMER_DOMAIN && ( <Route path="/some-path/" component={withDomainRequired(make(() => import('sentry/views/someView')))} /> )} <Route path="/organizations/:orgId/some-path/" component={withDomainRedirect(make(() => import('sentry/views/someView')))} /> </Framgnet> ``` However the introduced logic generated the routes in the opposite order, where the org slug version would get priority. For some future changes this becomes important so I am bringing back this matching behaviour
1 parent 3a7e9b3 commit 78d2f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

static/app/components/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Route.createRouteFromReactElement = function (element: RouteElement): PlainRoute
8080
];
8181

8282
if (USING_CUSTOMER_DOMAIN) {
83-
childRoutes.push({
83+
childRoutes.unshift({
8484
...createRouteFromReactElement(element),
8585
path,
8686
component: withDomainRequired(component ?? NoOp),

0 commit comments

Comments
 (0)