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

Explain that props are updated on navigation #6915

Merged
merged 8 commits into from
Mar 8, 2024
2 changes: 2 additions & 0 deletions src/content/docs/en/guides/view-transitions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ As a convenient shorthand, `transition:persist` can alternatively take a transit
<video controls="" autoplay="" transition:persist="media-player">
```

When you add `transition:persist` to an island, the state is retained upon navigation, but any props that change will be carried over to the new page, causing your component to re-render with new props, but the existing state. You can control this behavior with the `transition:persist-props` directive. Adding this directive will keep the existing props and not copy over new values.
matthewp marked this conversation as resolved.
Show resolved Hide resolved

### Built-in Animation Directives

Astro comes with a few built-in animations to override the default `fade` transition. Add the `transition:animate` directive to individual elements to customize the behavior of specific transitions.
Expand Down
Loading