accept string as second argument for matchPath (#30334)

This commit is contained in:
Aaron Ross
2018-11-07 07:30:55 +00:00
committed by John Reilly
parent cfa477710a
commit bc9057bf1d
+1 -1
View File
@@ -117,7 +117,7 @@ export interface match<Params extends { [K in keyof Params]?: string } = {}> {
// Omit taken from https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function matchPath<Params extends { [K in keyof Params]?: string }>(pathname: string, props: RouteProps, parent?: match<Params> | null): match<Params> | null;
export function matchPath<Params extends { [K in keyof Params]?: string }>(pathname: string, props: string | RouteProps, parent?: match<Params> | null): match<Params> | null;
export function generatePath(pattern: string, params?: { [paramName: string]: string | number | boolean }): string;