From 49e8085eea17eae057214cecfe786cc4c0513fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Can=20Eri=C5=9F?= Date: Fri, 17 May 2019 22:55:18 +0300 Subject: [PATCH] Fix optional erroneous types. (#35546) --- types/hookrouter/hookrouter-tests.ts | 4 ---- types/hookrouter/index.d.ts | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/types/hookrouter/hookrouter-tests.ts b/types/hookrouter/hookrouter-tests.ts index 534f374932..4830d209d8 100644 --- a/types/hookrouter/hookrouter-tests.ts +++ b/types/hookrouter/hookrouter-tests.ts @@ -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(); diff --git a/types/hookrouter/index.d.ts b/types/hookrouter/index.d.ts index 9076efa8df..c326745f95 100644 --- a/types/hookrouter/index.d.ts +++ b/types/hookrouter/index.d.ts @@ -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;