Skip to content

fix(router-core): type mismatch for navigate function #4625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-router/src/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export function useLinkProps<

// All is well? Navigate!
// N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing
return router.navigate({
router.navigate({
...options,
from,
replace,
Expand Down
2 changes: 1 addition & 1 deletion packages/router-core/src/RouterProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type NavigateFn = <
TMaskTo extends string = '',
>(
opts: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,
) => Promise<void> | void
) => Promise<void>

export type BuildLocationFn = <
TRouter extends RegisteredRouter,
Expand Down
2 changes: 1 addition & 1 deletion packages/router-core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ export class RouterCore<
} else {
window.location.href = href
}
return
return Promise.resolve()
}

return this.buildAndCommitLocation({
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router/src/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export function useLinkProps<

// All is well? Navigate!
// N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing
return router.navigate({
router.navigate({
..._options(),
replace: local.replace,
resetScroll: local.resetScroll,
Expand Down