From ec00206e18617552d77d396f006593279e6296cd Mon Sep 17 00:00:00 2001 From: "quisi.do" Date: Fri, 28 Jun 2024 00:32:58 -0700 Subject: [PATCH 1/2] remove private namespace `JSX` --- packages/react/src/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index ffb961bbfe3b..9c81f63cc0d5 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -1,5 +1,6 @@ // Disabling `no-explicit-any` for the whole file as `any` has became common requirement. /* eslint-disable @typescript-eslint/no-explicit-any */ +import type { ReactElement } from 'react'; export type Action = 'PUSH' | 'REPLACE' | 'POP'; @@ -67,7 +68,7 @@ export type UseNavigationType = () => Action; // react-router > 6.0.0 and >= 6.4.2. export type RouteObjectArrayAlias = any; export type RouteMatchAlias = any; -export type CreateRoutesFromChildren = (children: JSX.Element[]) => RouteObjectArrayAlias; +export type CreateRoutesFromChildren = (children: ReactElement[]) => RouteObjectArrayAlias; export type MatchRoutes = ( routes: RouteObjectArrayAlias, location: Location, From c7b6fb38143ba059209b48398836a71cb2d684cf Mon Sep 17 00:00:00 2001 From: "quisi.do" Date: Fri, 28 Jun 2024 00:34:16 -0700 Subject: [PATCH 2/2] remove private namespace `JSX` --- packages/react/src/reactrouter.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react/src/reactrouter.tsx b/packages/react/src/reactrouter.tsx index c15fb9d0b191..d52885dffa8d 100644 --- a/packages/react/src/reactrouter.tsx +++ b/packages/react/src/reactrouter.tsx @@ -16,6 +16,7 @@ import { import type { Client, Integration, Span, TransactionSource } from '@sentry/types'; import hoistNonReactStatics from 'hoist-non-react-statics'; import * as React from 'react'; +import type { ReactElement } from 'react'; import type { Action, Location } from './types'; @@ -32,7 +33,7 @@ export type RouteConfig = { [propName: string]: unknown; path?: string | string[]; exact?: boolean; - component?: JSX.Element; + component?: ReactElement; routes?: RouteConfig[]; };