Skip to content

Commit 1a1f081

Browse files
ellieloksarah11918
andauthored
Remove ViewTransitions in v6 (#12347)
Co-authored-by: Sarah Rainsberger <[email protected]>
1 parent 64ea345 commit 1a1f081

File tree

1 file changed

+27
-0
lines changed
  • src/content/docs/en/guides/upgrade-to

1 file changed

+27
-0
lines changed

src/content/docs/en/guides/upgrade-to/v6.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,33 @@ The following features have now been entirely removed from the code base and can
7575

7676
Projects now containing these removed features will be unable to build, and there will no longer be any supporting documentation prompting you to remove these features.
7777

78+
### Removed: `<ViewTransitions />` component
79+
80+
<SourcePR number="14400" title="Remove deprecated ViewTransitions component"/>
81+
82+
In Astro 5.0, the `<ViewTransitions />` component was renamed to `<ClientRouter />` to clarify the role of the component. The new name makes it more clear that the features you get from Astro's `<ClientRouter />` routing component are slightly different from the native CSS-based MPA router. However, a deprecated version of the `<ViewTransitions />` component still existed and may have functioned in Astro 5.x.
83+
84+
Astro 6.0 removes the `<ViewTransitions />` component entirely and it can no longer be used in your project. Update to the `<ClientRouter />` component to continue to use these features.
85+
86+
#### What should I do?
87+
88+
Replace all occurrences of the `ViewTransitions` import and component with `ClientRouter`:
89+
90+
```astro title="src/layouts/MyLayout.astro" del={1,7} ins={2,8}
91+
import { ViewTransitions } from 'astro:transitions';
92+
import { ClientRouter } from 'astro:transitions';
93+
94+
<html>
95+
<head>
96+
...
97+
<ViewTransitions />
98+
<ClientRouter />
99+
</head>
100+
</html>
101+
```
102+
103+
<ReadMore>Read more about [view transitions and client-side routing in Astro](/en/guides/view-transitions/).</ReadMore>
104+
78105
## Changed Defaults
79106

80107
Some default behavior has changed in Astro v5.0 and your project code may need updating to account for these changes.

0 commit comments

Comments
 (0)