From 0adead109d631858eee89066a5d87777e4d3eac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gert=20S=C3=B8nderby?= Date: Wed, 4 Apr 2018 11:05:05 +0200 Subject: [PATCH] Made optional arguments for browser router optional in flow type. --- src/environment/browser-router.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/environment/browser-router.js b/src/environment/browser-router.js index 3fa11697..fae921d2 100644 --- a/src/environment/browser-router.js +++ b/src/environment/browser-router.js @@ -8,9 +8,9 @@ import install from '../install'; type BrowserRouterArgs = { routes: Object, - basename: string, - historyOptions: BrowserHistoryOptions, - history: History + basename?: string, + historyOptions?: BrowserHistoryOptions, + history?: History }; export const createBrowserRouter = (installer: Function) => ({ @@ -28,7 +28,7 @@ export const createBrowserRouter = (installer: Function) => ({ // Strip the basename from the initial pathname const pathname = - fullPathname.indexOf(basename) === 0 + basename && fullPathname.indexOf(basename) === 0 ? fullPathname.slice(basename.length) : fullPathname;