Fix optional erroneous types. (#35546)

This commit is contained in:
Mete Can Eriş
2019-05-17 12:55:18 -07:00
committed by Nathan Shively-Sanders
parent 8459d5ed79
commit 49e8085eea
2 changed files with 2 additions and 6 deletions
-4
View File
@@ -18,7 +18,6 @@ import {
prepareRoute,
useQueryParams
} from 'hookrouter';
import * as React from 'react';
// $ExpectType AProps
setLinkProps({ href: '/route' });
@@ -74,8 +73,5 @@ usePath(true, true);
// $ExpectType string
getWorkingPath('id');
// $ExpectType ReactNode
useRoutes({ '/route:id': ({ id }) => React.createElement('div', { children: 'Route Component' }) });
// $ExpectType string
getTitle();
+2 -2
View File
@@ -42,7 +42,7 @@ export function resolvePath(inPath: string): string;
export function prepareRoute(inRoute: string): [RegExp, string[]];
export function navigate(
url: string,
replace: true,
replace?: boolean,
queryParams?: HookRouter.QueryParams | null,
replaceQueryParams?: boolean
): void;
@@ -51,6 +51,6 @@ export function getPath(): string;
export function usePath(active?: boolean, withBasePath?: boolean): string;
export function updatePathHooks(): void;
export function getWorkingPath(parentRouterId: string): string;
export function useRoutes(routeObj: HookRouter.RouteObject): React.ReactNode;
export function useRoutes(routeObj: HookRouter.RouteObject): any;
export function useTitle(inString: string): void;
export function getTitle(): string;