Skip to content

Commit

Permalink
fix: default options
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jan 24, 2023
1 parent b47c348 commit 98870f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/router/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ export class Route<
TAllParams
>,
) {
this.options = options as any
this.isRoot = !options.getParentRoute as any
this.options = (options as any) || {}
this.isRoot = !options?.getParentRoute as any
}

init = () => {
Expand All @@ -311,9 +311,9 @@ export class Route<
> &
RouteOptionsBaseIntersection<TCustomId, TPath>

const isRoot = !allOptions.path && !allOptions.id
const isRoot = !allOptions?.path && !allOptions?.id

const parent = this.options.getParentRoute?.()
const parent = this.options?.getParentRoute?.()

if (isRoot) {
this.path = rootRouteId as TPath
Expand All @@ -331,7 +331,7 @@ export class Route<
path = trimPath(path)
}

const customId = allOptions.id || path
const customId = allOptions?.id || path

// Strip the parentId prefix from the first level of children
let id = isRoot
Expand Down

0 comments on commit 98870f4

Please sign in to comment.