Skip to content

Commit b367dd7

Browse files
committed
fix(tanstack-router): resolve declaration build errors
1 parent 3940c88 commit b367dd7

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/tanstack-router/src/bindings.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export const routerProvider: RouterProvider = {
7171
hash: hasUrlHash ? normalizedHash : undefined,
7272
replace: type === "replace",
7373
});
74+
75+
return;
7476
},
7577
[existingHash, existingSearch, navigate, pathname, router],
7678
);

packages/tanstack-router/src/unsaved-changes-notifier.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export const UnsavedChangesNotifier: React.FC<UnsavedChangesNotifierProps> = ({
2323
return translate(translationKey, message);
2424
}, [translationKey, message, translate]);
2525

26+
const serializedSearch = React.useMemo(() => {
27+
return JSON.stringify(location.search);
28+
}, [location.search]);
29+
2630
const blocker = useBlocker({
2731
shouldBlockFn: ({ next }) => {
2832
if (!warnWhen) {
@@ -31,8 +35,7 @@ export const UnsavedChangesNotifier: React.FC<UnsavedChangesNotifierProps> = ({
3135

3236
return (
3337
next.pathname !== location.pathname ||
34-
next.searchStr !== location.searchStr ||
35-
next.hash !== location.hash
38+
JSON.stringify(next.search) !== serializedSearch
3639
);
3740
},
3841
enableBeforeUnload: warnWhen,

0 commit comments

Comments
 (0)