Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions static/app/types/legacyReactRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
*/
import type {Location, LocationDescriptor} from 'history';

export type RouteComponent = React.ComponentClass<any> | React.FunctionComponent<any>;

interface IndexRouteProps<Props = any> {
component?: RouteComponent | undefined;
component?: React.ComponentType<any> | undefined;
props?: Props | undefined;
}

Expand Down
3 changes: 1 addition & 2 deletions static/app/utils/withDomainRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<any>) {
// eslint-disable-next-line @typescript-eslint/no-restricted-types
return function WithDomainRedirectWrapper(props: object) {
const {customerDomain, links, features} = ConfigStore.getState();
Expand Down
3 changes: 1 addition & 2 deletions static/app/utils/withDomainRequired.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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<any>) {
// eslint-disable-next-line @typescript-eslint/no-restricted-types
return function WithDomainRequiredWrapper(props: object) {
const params = useParams();
Expand Down
Loading