Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update script behavior section #6798

Merged
merged 14 commits into from
Mar 9, 2024
Merged
Prev Previous commit
Next Next commit
Update src/content/docs/en/guides/view-transitions.mdx
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
  • Loading branch information
OliverSpeir and martrapp authored Feb 6, 2024
commit 212bde3b015bba2485290d34aaf993f35b566e73
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/view-transitions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ If you have code that sets up global state in an inline script, this state will
Inline scripts can be reexecuted after every transition by adding the `data-astro-reload` property. This will make the script `is:inline` implicitly, so it will not work for bundled scripts.

```astro
<script data-astro-reload></script>
<script data-astro-reload>...</script>
```

If a script should execute every time a page is loaded, it should be executed by a [Lifecycle event](#lifecycle-events). Event listeners for `DOMContentLoaded` can be replaced by the [`astro:page-load`](http://localhost:4321/en/guides/view-transitions/#astropage-load) [Lifecycle event](#lifecycle-events).
Expand Down
Loading