From ab8118ecdb0dbeac0d516e00804263a9eb19162f Mon Sep 17 00:00:00 2001 From: laohan <120936337@qq.com> Date: Mon, 13 Dec 2021 21:16:36 +0800 Subject: [PATCH] Fix `RouteProps` type (#8473) Co-authored-by: hanquliu --- packages/react-router/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-router/index.tsx b/packages/react-router/index.tsx index f90915aad4..a7c025b4df 100644 --- a/packages/react-router/index.tsx +++ b/packages/react-router/index.tsx @@ -196,7 +196,7 @@ export function Outlet(props: OutletProps): React.ReactElement | null { export interface RouteProps { caseSensitive?: boolean; children?: React.ReactNode; - element?: React.ReactElement | null; + element?: React.ReactNode | null; index?: boolean; path?: string; } @@ -204,18 +204,18 @@ export interface RouteProps { export interface PathRouteProps { caseSensitive?: boolean; children?: React.ReactNode; - element?: React.ReactElement | null; + element?: React.ReactNode | null; index?: false; path: string; } export interface LayoutRouteProps { children?: React.ReactNode; - element?: React.ReactElement | null; + element?: React.ReactNode | null; } export interface IndexRouteProps { - element?: React.ReactElement | null; + element?: React.ReactNode | null; index: true; }