From 6b0d46e107fe63d2e6c9d125ee586c0662e8e6fc Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Thu, 10 Nov 2022 07:39:29 -0700 Subject: [PATCH] refactor: isServer --- packages/router-core/src/router.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts index 00330c5a56..559e3f7449 100644 --- a/packages/router-core/src/router.ts +++ b/packages/router-core/src/router.ts @@ -320,13 +320,12 @@ export interface Router< } // Detect if we're in the DOM -const isServer = Boolean( - typeof window === 'undefined' || !window.document?.createElement, -) +const isServer = + typeof window === 'undefined' || !window.document?.createElement // This is the default history object if none is defined const createDefaultHistory = () => - !isServer ? createBrowserHistory() : createMemoryHistory() + isServer ? createMemoryHistory() : createBrowserHistory() export function createRouter< TRouteConfig extends AnyRouteConfig = RouteConfig,