Skip to content

Commit

Permalink
fix(react): Match routes with parseSearch option in TanStack Router…
Browse files Browse the repository at this point in the history
… instrumentation (#14328)
  • Loading branch information
lsmurray authored Dec 3, 2024
1 parent 9581a2e commit b0729b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/tanstackrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function tanstackRouterBrowserTracingIntegration(
if (instrumentPageLoad && initialWindowLocation) {
const matchedRoutes = castRouterInstance.matchRoutes(
initialWindowLocation.pathname,
initialWindowLocation.search,
castRouterInstance.options.parseSearch(initialWindowLocation.search),
{ preload: false, throwOnError: false },
);

Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/vendor/tanstackrouter-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ SOFTWARE.
export interface VendoredTanstackRouter {
history: VendoredTanstackRouterHistory;
state: VendoredTanstackRouterState;
options: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parseSearch: (search: string) => Record<string, any>;
};
matchRoutes: (
pathname: string,
// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down

0 comments on commit b0729b6

Please sign in to comment.