Skip to content
Merged
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: 3 additions & 1 deletion packages/react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface NonIndexRouteObject {
caseSensitive?: boolean;
children?: RouteObject[];
element?: React.ReactNode | null;
errorElement?: React.ReactNode | null;
index?: any;
path?: string;
}
Expand All @@ -28,14 +29,15 @@ export interface IndexRouteObject {
caseSensitive?: boolean;
children?: undefined;
element?: React.ReactNode | null;
errorElement?: React.ReactNode | null;
index: any;
path?: string;
}

// This type was originally just `type RouteObject = IndexRouteObject`, but this was changed
// in https://github.com/remix-run/react-router/pull/9366, which was released with `6.4.2`
// See https://github.com/remix-run/react-router/issues/9427 for a discussion on this.
export type RouteObject = IndexRouteObject | NonIndexRouteObject;
export type RouteObject = (IndexRouteObject | NonIndexRouteObject) & Record<string, any>;

export type Params<Key extends string = string> = {
readonly [key in Key]: string | undefined;
Expand Down