Skip to content

Instantly share code, notes, and snippets.

@netaisllc
Created November 19, 2023 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netaisllc/3cc72bb35ace64ceca4425374e452930 to your computer and use it in GitHub Desktop.
Save netaisllc/3cc72bb35ace64ceca4425374e452930 to your computer and use it in GitHub Desktop.
Astro wrapper component to handle HMTX and Astro ViewTransistions
---
import { ViewTransitions } from 'astro:transitions'
---
<ViewTransitions />
<script>
// List for Astro to report swap is complete so Htmx can reparse the DOM
document.addEventListener('astro:after-swap', () => {
window.htmx.process(document.body)
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment