Skip to content

Commit 91a241d

Browse files
JubayeromiCopilot
andcommitted
docs: explain root view transition snapshots
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2e6dca1 commit 91a241d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/content/reference/react/ViewTransition.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,6 +2775,12 @@ React waits for any pending Navigation to finish to ensure that scroll restorati
27752775

27762776
If a `startTransition` is started from the legacy popstate event, such as during a "back"-navigation then it must finish synchronously to ensure scroll and form restoration works correctly. This is in conflict with running a View Transition animation. Therefore, React will skip animations from popstate and animations won't run for the back button. You can fix this by upgrading your router to use the Navigation API.
27772777

2778+
#### Animating only the root snapshot {/*animating-only-the-root-snapshot*/}
2779+
2780+
React starts a browser View Transition when a `<ViewTransition>` activates, but this does not guarantee that the browser's root snapshot will be available. React may cancel the root snapshot when it determines that the transition does not affect the root layout. For example, a small keyed `<ViewTransition enter="auto" exit="auto">` can start a transition, but does not by itself guarantee that the root snapshot is kept. A boundary that changes size and affects its parent layout may cause React to keep the root snapshot; changes in a portal may also affect it.
2781+
2782+
2783+
27782784
---
27792785

27802786
## Troubleshooting {/*troubleshooting*/}

0 commit comments

Comments
 (0)