Skip to content

Commit

Permalink
docs: tell people to avoid goto(external)
Browse files Browse the repository at this point in the history
related to #8775
  • Loading branch information
Rich-Harris authored Feb 3, 2023
1 parent fa31965 commit 02bd767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-pans-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

docs: discourage use of `goto` with external URLs
1 change: 1 addition & 0 deletions packages/kit/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ declare module '$app/navigation' {
export function disableScrollHandling(): void;
/**
* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
* For external URLs, use `window.location = url` instead of calling `goto(url)`.
*
* @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
* @param opts Options related to the navigation
Expand Down

0 comments on commit 02bd767

Please sign in to comment.