From fdd666d463505f6defff8b4e2b6dd0099f2eac8c Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Thu, 21 May 2026 09:32:52 -0400 Subject: [PATCH] ref(ts): Remove RouteComponent --- static/app/types/legacyReactRouter.tsx | 4 +--- static/app/utils/withDomainRedirect.tsx | 3 +-- static/app/utils/withDomainRequired.tsx | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/static/app/types/legacyReactRouter.tsx b/static/app/types/legacyReactRouter.tsx index 800c0681ee91bf..75549960ebab5e 100644 --- a/static/app/types/legacyReactRouter.tsx +++ b/static/app/types/legacyReactRouter.tsx @@ -5,10 +5,8 @@ */ import type {Location, LocationDescriptor} from 'history'; -export type RouteComponent = React.ComponentClass | React.FunctionComponent; - interface IndexRouteProps { - component?: RouteComponent | undefined; + component?: React.ComponentType | undefined; props?: Props | undefined; } diff --git a/static/app/utils/withDomainRedirect.tsx b/static/app/utils/withDomainRedirect.tsx index 9e620df81297c1..507f02c98cb706 100644 --- a/static/app/utils/withDomainRedirect.tsx +++ b/static/app/utils/withDomainRedirect.tsx @@ -5,7 +5,6 @@ import trimStart from 'lodash/trimStart'; import {Redirect} from 'sentry/components/redirect'; import {ConfigStore} from 'sentry/stores/configStore'; -import type {RouteComponent} from 'sentry/types/legacyReactRouter'; import {recreateRoute} from 'sentry/utils/recreateRoute'; import {testableWindowLocation} from 'sentry/utils/testableWindowLocation'; import {normalizeUrl} from 'sentry/utils/url/normalizeUrl'; @@ -33,7 +32,7 @@ import {useOrganization} from './useOrganization'; * If either a customer domain is not being used, or if :orgId is not present in the route path, then WrappedComponent * is rendered. */ -export function withDomainRedirect(WrappedComponent: RouteComponent) { +export function withDomainRedirect(WrappedComponent: React.ComponentType) { // eslint-disable-next-line @typescript-eslint/no-restricted-types return function WithDomainRedirectWrapper(props: object) { const {customerDomain, links, features} = ConfigStore.getState(); diff --git a/static/app/utils/withDomainRequired.tsx b/static/app/utils/withDomainRequired.tsx index b717109418abc1..b41b4990b6edca 100644 --- a/static/app/utils/withDomainRequired.tsx +++ b/static/app/utils/withDomainRequired.tsx @@ -2,7 +2,6 @@ import trimEnd from 'lodash/trimEnd'; import trimStart from 'lodash/trimStart'; import {ConfigStore} from 'sentry/stores/configStore'; -import type {RouteComponent} from 'sentry/types/legacyReactRouter'; import {testableWindowLocation} from 'sentry/utils/testableWindowLocation'; import {useParams} from 'sentry/utils/useParams'; @@ -30,7 +29,7 @@ import {useParams} from 'sentry/utils/useParams'; * * Whenever https://orgslug.sentry.io/ is accessed in the browser, then both conditions above will be satisfied. */ -export function withDomainRequired(WrappedComponent: RouteComponent) { +export function withDomainRequired(WrappedComponent: React.ComponentType) { // eslint-disable-next-line @typescript-eslint/no-restricted-types return function WithDomainRequiredWrapper(props: object) { const params = useParams();