Skip to content

Commit

Permalink
refactor: isServer
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Nov 10, 2022
1 parent 57495ba commit 6b0d46e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/router-core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6b0d46e

Please sign in to comment.