Skip to content

Commit

Permalink
fix: default strict:false for getRouteApi instances
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Mar 12, 2024
1 parent d64f0c0 commit d73ee82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-router/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,13 @@ export class RouteApi<
useLoaderDeps = <TSelected = TLoaderDeps>(opts?: {
select?: (s: TLoaderDeps) => TSelected
}): TSelected => {
return useLoaderDeps({ ...opts, from: this.id } as any)
return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)

This comment has been minimized.

Copy link
@jakst

jakst Mar 12, 2024

Contributor

@tannerlinsley The title of the commit says default strict:false, but won't this always make strict: false? If it's an overridable default I think it needs to be like this:

return useLoaderDeps({ from: this.id, strict: false, ...opts } as any)
}

useLoaderData = <TSelected = TLoaderData>(opts?: {
select?: (s: TLoaderData) => TSelected
}): TSelected => {
return useLoaderData({ ...opts, from: this.id } as any)
return useLoaderData({ ...opts, from: this.id, strict: false } as any)
}

notFound = (opts?: NotFoundError) => {
Expand Down

0 comments on commit d73ee82

Please sign in to comment.