Skip to content

Commit

Permalink
fix: syntax error in changelog (#11869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored Aug 29, 2024
1 parent a85a184 commit 9da5b3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .changeset/new-monkeys-sit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
'astro': minor
---

Adds a new object `swapFunctions` to expose the necessary utility functions on `astro:transitions/client` that allow you to build custom swap functions to be used with view transitions.
Adds a new object `swapFunctions` to expose the necessary utility functions on `astro:transitions/client` that allow you to build custom swap functions to be used with view transitions.

The example below uses these functions to replace Astro's built-in default `swap` function with one that only swaps the `<main>` part of the page:

```astro
```html
<script>
import { swapFunctions } from 'astro:transitions/client';
Expand All @@ -26,7 +26,7 @@ function swapMainOnly(doc: Document) {
}
restoreFocusFunction();
};
<script>
</script>
```

See the [view transitions guide](https://docs.astro.build/en/guides/view-transitions/#astrobefore-swap) for more information about hooking into the `astro:before-swap` lifecycle event and adding a custom swap implementation.

0 comments on commit 9da5b3d

Please sign in to comment.