Skip to content

Commit 95557e7

Browse files
committed
tweaks
1 parent 7f93468 commit 95557e7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

documentation/docs/30-advanced/67-shallow-routing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ SvelteKit makes this possible with the [`goto`]($app-navigation#goto) function,
3030
{/if}
3131
```
3232

33-
Because the navigation doesn't run `load` functions or switch to a different `+page.svelte`, we call this **shallow routing**.
33+
Because the navigation doesn't run `load` functions, switch to a different `+page.svelte`, or (by default) reset scroll and focus, we call this _shallow routing_.
3434

3535
State can be accessed through the [page object]($app-state#page) as `page.state`. You can make page state type-safe by declaring an [`App.PageState`](types#PageState) interface (usually in `src/app.d.ts`).
3636

3737
The modal can be dismissed by navigating back (unsetting `page.state.showModal`) or by interacting with it in a way that causes the `close` callback to run, which will navigate back programmatically.
3838

39-
4039
You can also update the visible URL during a shallow navigation:
4140

4241
```js
@@ -50,7 +49,7 @@ goto('/photos/1', {
5049

5150
Regardless of whether you choose to update the visible URL or not, [`beforeNavigate`]($app-navigation#beforeNavigate), [`onNavigate`]($app-navigation#onNavigate) and [`afterNavigate`]($app-navigation#afterNavigate) will run with `navigation.type === 'goto'` and `navigation.shallow === true`.
5251

53-
Once shallow routing is active, `page.shallow` is set with the visible URL, parameters and route id. `page.url`, `page.params` and `page.route` continue to describe the page that was last rendered as a result of an actual navigation.
52+
Once shallow routing is active, `page.shallow` becomes a `{ url, params, route }` object describing the page that _would_ be rendered if the user were to navigate there (which would happen if, for example, they reloaded the page). `page.url`, `page.params` and `page.route` continue to describe the page that is currently rendered.
5453

5554
```svelte
5655
<!--- file: +page.svelte --->

0 commit comments

Comments
 (0)