63bc37f2b6
* refactored CSR into goto() function * first refectoring for router API * added test * added comments to fixture * rename + preliminary changeset * changeset: now 'minor' and featuring Mathew's example from the docs * moved for simpler diff * update after #8617 * fixed ts-errors * more comprehensible handling of intra-page state * sync with main * synch from next_tm
17 lines
412 B
Markdown
17 lines
412 B
Markdown
---
|
|
'astro': minor
|
|
---
|
|
|
|
View transitions can now be triggered from JavaScript!
|
|
|
|
Import the client-side router from "astro:transitions/client" and enjoy your new remote control for navigation:
|
|
|
|
```js
|
|
import { navigate } from 'astro:transitions/client';
|
|
|
|
// Navigate to the selected option automatically.
|
|
document.querySelector('select').onchange = (ev) => {
|
|
let href = ev.target.value;
|
|
navigate(href);
|
|
};
|
|
```
|