#Javascript/Typescript modules are not loading when navigating forward/ back using ViewTransitions
4 messages · Page 1 of 1 (latest)
Hey @vague crag! You'll need to re-initialize any functions in your scripts after the page swap. You can use the astro:after-swap eventListener to do this: https://docs.astro.build/en/guides/view-transitions/#astroafter-swap
Ok, thanks! Is it possible to only run the functions in the modules on certain pages?
You could make sure the script is only included on the pages that need it (an Astro layout is helpful for this)